On 23-Nov-01 Luigi Rizzo wrote:
> In order to port my network polling stuff to current, I was looking
> at ways to do things within the "idle loop", and was pointed to
> the idle_proc() or vm_pagezero() . I am listing below the code
> for these kernel threads (I hope the name is the correct one).
> I do not follow, however, the reason why these two threads periodically
> give up the CPU, given that their priority is (i guess) lower than
> any other thread in the system, so any event that should wake up
> a thread would immediately cause their preemption.
> Where am i wrong ?
We don't do preemption in the kernel yet, so they need to yield the CPU when
another thread is available. The page zeroing thread does this wrong as it
should check procrunnable() instead of switching after doing N pages. The idle
loop idle_proc() can't do any work w/o breaking priority propagation. If you
wish to do low priority work, create a idle priority kthread to do it and make
sure it yields when there is other work to do of higher priority.
John Baldwin <[EMAIL PROTECTED]> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message