Re: Idle priority
Re: Idle priority
- Subject: Re: Idle priority
- From: Terry Lambert <email@hidden>
- Date: Wed, 29 Jul 2009 21:10:17 -0700
On Jul 29, 2009, at 10:52 AM, Jonas Maebe wrote:
On 29 Jul 2009, at 08:44, Mike Mimic wrote:
Is it possible to make a program run under "idle priority"
scheduling class?
No. I filed a radar about this in 2001 or 2002 and it came back with
"behaves as expected" (although this was simply about the fact that
renicing a process to nice level 19 does not give the process idle
priority).
There are no BSD APIs to do this. This is intentional.
There are only 10 possible Mach scheduler priorities below the nice
value you are specifying, which is 11 (idle is 0). These 10 are aged
priorities which have been lowered because those threads are pretty
much not doing anything useful enough for them to be scheduled (see
osfmk/kern/sched.h for documentation).
You can't actually run *in place of* the per-CPU idle thread because
that's where power management code runs on an idle system, and if you
did, you would effectively disable power management, which is a bad
idea. Unless the question is really "how do I disable power
management?" in which case the answer is to compile your own kernel
with that code diked out so there's noting but a halt instruction,
which is the default idle before power management is enabled.
So unless you are intending to disable power management, then the
minimum Mach priority is actually 1, not 0. I don't personally see
the utility of exposing the aged priority band below Mach priority 11
as being somehow useful or beneficial to anything but trying to damage
the scheduler ageing mechanisms operation, or disabling power
management. For a user process, this certainly makes no sense
whatsoever, since a user process can't guarantee that it's not going
to call a blocking call at some point anyway, at which point you still
need a real idle thread.
How about you guys describe what you are trying to do?
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden