lkml.org 
[lkml]   [2014]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] workqueues: Account unbound workqueue in a seperate list
On Thu, Mar 27, 2014 at 06:21:00PM +0100, Frederic Weisbecker wrote:
> The workqueues are all listed in a global list protected by a big mutex.
> And this big mutex is used in apply_workqueue_attrs() as well.
>
> Now as we plan to implement a directory to control the cpumask of
> all non-ABI unbound workqueues, we want to be able to iterate over all
> unbound workqueues and call apply_workqueue_attrs() for each of
> them with the new cpumask.
>
> But the risk for a deadlock is on the way: we need to iterate the list
> of workqueues under wq_pool_mutex. But then apply_workqueue_attrs()
> itself calls wq_pool_mutex.

Wouldn't the right thing to do would be factoring out
apply_workqueue_attrs_locked()? It's cleaner to block out addition of
new workqueues while the masks are being updated anyway.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2014-03-30 15:41    [W:0.224 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site