Re: [PATCH 1/3 v2] wait: introduce wait_event_exclusive_cmd

2015-04-29 Thread NeilBrown
On Wed, 29 Apr 2015 11:31:09 +0200 Peter Zijlstra wrote: > On Wed, Apr 29, 2015 at 10:48:53AM +0800, Yuanhan Liu wrote: > > It's just a variant of wait_event_cmd(), with exclusive flag being set. > > > > For cases like RAID5, which puts many processes to sleep until 1/4 > > resources are free, a

Re: [PATCH 1/3 v2] wait: introduce wait_event_exclusive_cmd

2015-04-29 Thread Peter Zijlstra
On Wed, Apr 29, 2015 at 10:48:53AM +0800, Yuanhan Liu wrote: > It's just a variant of wait_event_cmd(), with exclusive flag being set. > > For cases like RAID5, which puts many processes to sleep until 1/4 > resources are free, a wake_up wakes up all processes to run, but > there is one process be

[PATCH 1/3 v2] wait: introduce wait_event_exclusive_cmd

2015-04-28 Thread Yuanhan Liu
It's just a variant of wait_event_cmd(), with exclusive flag being set. For cases like RAID5, which puts many processes to sleep until 1/4 resources are free, a wake_up wakes up all processes to run, but there is one process being able to get the resource as it's protected by a spin lock. That end