lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2] workqueue: fix possible race condition when rescuer VS pwq-release
On Fri, Mar 28, 2014 at 08:07:58PM +0800, Lai Jiangshan wrote:
> +static inline void get_unbound_pwq(struct pool_workqueue *pwq)
> +{
> + if (pwq->wq->flags & WQ_UNBOUND)
> + get_pwq(pwq);
> +}
> +
> /**
> * put_pwq - put a pool_workqueue reference
> * @pwq: pool_workqueue to put
> @@ -1075,6 +1081,12 @@ static void put_pwq(struct pool_workqueue *pwq)
> schedule_work(&pwq->unbound_release_work);
> }
>
> +static inline void put_unbound_pwq(struct pool_workqueue *pwq)
> +{
> + if (pwq->wq->flags & WQ_UNBOUND)
> + put_pwq(pwq);
> +}

Ugh... please drop these helpers.

> + get_unbound_pwq(pwq);

Why not just do get_pwq() here?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2014-04-15 19:01    [W:0.098 / U:6.388 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site