Subject: Re: Scheduler locking change
To: None <ad@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 05/07/2007 07:42:51
> Hi,
> 
> For the yamt-idlelwp branch I made a patch that changes the locking strategy
> slightly. It assigns a per-CPU lock to LWPs as they transition to the ONPROC
> state. This works well because external agents are not usually interested in
> running LWPs, but an LWP must lock itself before going to sleep. It wasn't
> possible to do this before since cpu_switch() made things quite a bit more
> complicated.
> 
> Without the change it is possible for the scheduler to call spc_lock() and
> then all running and runnable LWPs assigned to the target CPU are locked.
> With this change, spc_lock() will only lock LWPs that are on a run queue.
> Can anyone see a potential situation where this is likely to cause a problem
> for the scheduler?

i don't see any problem.

YAMAMOTO Takashi