- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Priority Calculation for timeshare processes
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2003 10:45 PM
03-25-2003 10:45 PM
We are trying to understand how the priorities are internally calculated by HP (we are using 10.20).
Is there some document available on how priorities are calculated depending on the CPU usage?
Thanks,
Prashanth
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2003 07:48 AM
03-26-2003 07:48 AM
Re: Priority Calculation for timeshare processes
Look in /usr/share/doc for proc_mgt.txt. The description of process scheduling is outlined there.
Regards,
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2003 09:48 PM
03-26-2003 09:48 PM
Re: Priority Calculation for timeshare processes
Other than nice, is there any other mechanism to control the priorities of timeshare processes? Either statically or at runtime?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2003 01:29 AM
03-27-2003 01:29 AM
SolutionI'm not going to repeat everything the Process Management White Paper says, but what I will mention here is better understood looking at the Timeline section under the Thread Scheduling chapter.
The formula used by calcusrpri() is:
pri = (kt_cpu/4) + PUSER + 2*(p_nice - NZERO)
A little description of the terms:
PUSER = base priority of user processes = 178
NZERO = 20
pri = process priority
p_nice = nice value of process
kt_cpu = cpu usage estimator, incremented by one each clock tick. Looking at the diagram I mentioned shows setpri() is run every 40ms, hence the formula value.
You can find a lot of this in /usr/include/sys/param.h
You won't find too much more without doing an Internals course I'm afraid. It may also be worth getting a Unix Internals book, a good one I always mention is:
Unix Internals: The New Frontier by Uresh Vahalia.
You would see from this the formula is very similar to the SVR3 implemtation.
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2003 10:49 PM
06-16-2003 10:49 PM
Re: Priority Calculation for timeshare processes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2003 08:32 AM
06-18-2003 08:32 AM
Re: Priority Calculation for timeshare processes
It might be worth asking this is a new thread but I'll try and answer anyway...
Timeshare processes have the external range 128-255. By external I mean external to the kernel and what you see from tools like ps. The base priority is TIMESHARE which is equal to 128. Values from 128 to 177 are termed system level priorities. Values from 178 (PUSER) to 255 are termed user level priorities. There is also a key priority at 153 - processes that have a priority equal to or below this are not signalable. A good example here is the shell - if you check the priority of your shell using ps, you will no doubt see it at 178 as it is in user land. If you check it from another terminal when it is idle it will be at 154, the highest priority it can be that will allow it to be signalled.
Anyway, I digress....looking at the timeline in the white paper the setpri() routine is called just before calcusrpri(). The setpri routine only adjusts the priority if this is greater than PUSER, or 178. So it appears that system level priorities do not change. Also, user level priorities can be made to be of type SCHED_NOAGE (see /usr/include/sys/sched.h) which means they have a fixed user level priority. To find out the scheduling policy I think you need to walk the kernel. I'm on 11i, have taken pid 1571 at random (its actually perflbd):
q4> load proc_t from proc_list next p_factp max nproc
q4> keep p_pid == 1571
q4> print -x p_schedpolicy
p_schedpolicy 0x2
So 0x2 is timeshare for the sched.h header file.
These priority definitions will be set in the source code I believe, so I don't believe you will be able to dynamically modify these, however a programmer may be better placed to answer this. A good starting reference may be the pthread man page. I suspect the problem using a lot of CPU will not be down to its given priority per-say, but some other event. If you let me know the name of this process it might be a known issue.
regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2003 11:08 PM
06-30-2003 11:08 PM