cvs commit: src/sys/kern sched_ule.c
David Xu
davidxu at freebsd.org
Wed Jan 24 07:49:51 UTC 2007
Jeff Roberson wrote:
> On Wed, 24 Jan 2007, David Xu wrote:
>
>> Jeff Roberson wrote:
>>
>>>> if idlethread is preempted, who will clear its idle bit in
>>>> idle_cpus_mask ?
>>>
>>>
>>>
>>> idle_cpus_mask was broken before for all schedulers. This commit
>>> didn't change that. ULE doesn't use idle_cpus_mask and it's
>>> idlethread doesn't set or clear it. The idle thread for the other
>>> schedulers remains unchanged.
>>>
>> I havn't read ULE code, but 4BSD has following code:
>>
>
> This is the very same code that was there before. I didn't change it.
> I just moved it into the schedulers. It was always broken with
> preemption. I tried to use idle_cpus_mask in ULE but found that it
> always was set for most CPUs. You will find that IPI_PREEMPT also had
> no effect but I fixed that recently.
>
orignal code does not preempt per-cpu idle thread, so the idle threads
have chance to clear their idle bits in idle_cpu_masks, but now because
the threads can be preempted directly, so they don't have chance
to clear the masks, unless sched_switch clears them( but the code is not
there), without clearing them, very cpu will receive a broadcast IPI
whenever a thread is added to runqueue for 4BSD scheduler, this is
incorrect if a cpu is already running a non-idle thread.
More information about the cvs-src
mailing list