lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <503D7CBB.9080301@cn.fujitsu.com>
Date:	Wed, 29 Aug 2012 10:21:47 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	Tejun Heo <tj@...nel.org>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] workqueue: single pass rebind_workers

On 08/28/2012 03:04 AM, Tejun Heo wrote:
> Hello, Lai.
> 
> On Tue, Aug 28, 2012 at 01:58:24AM +0800, Lai Jiangshan wrote:
>> busy_worker_rebind_fn() can't return until all idle workers are rebound,
>> the code of busy_worker_rebind_fn() ensure this.
>>
>> So we can change the order of the code of rebind_workers(),
>> and make it a single pass do the rebind_workers().
>>
>> It makes the code much clean and better readability.
> 
> I can't see how this could be correct.  

Could you elaborate more why it is not correct. 

> What prevents busy worker from
> grabbing manager_mutex before idle one?
> 

busy worker still has WORKER_REBIND when it enter busy_worker_rebind_fn(),
so it can sleep(include grab the manager_mutex). When this mutex_lock()
returns, it means rebind_workers() are done which means all idle are rebound
and can be locally woken up. So busy worker can return from busy_worker_rebind_fn()
and handle other possible-sleeping items.

If the CPU is offline again, the busy worker has WORKER_UNBOUND, it is also correct
when it returns from busy_worker_rebind_fn().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ