Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-26 Thread Tejun Heo
On Mon, May 26, 2014 at 01:27:55PM +0800, Lai Jiangshan wrote: > changing pwq: > install pwq > lock(pool->lock) > put_pwq(); > unlock(pool->lock) > > __queue_work(): > lock(pool->lock) > test ref and find it zero; > see the installation here; > it is

Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-25 Thread Lai Jiangshan
On 05/26/2014 12:23 PM, Tejun Heo wrote: > On Thu, May 22, 2014 at 10:21:25PM +0800, Lai Jiangshan wrote: >> On Thu, May 22, 2014 at 9:47 PM, Tejun Heo wrote: >> This is not busy wait, the retry and numa_pwq_tbl() guarantee that >> the retry will get a new pwq (even without cpu_relax()) as the com

Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-25 Thread Tejun Heo
On Thu, May 22, 2014 at 10:21:25PM +0800, Lai Jiangshan wrote: > On Thu, May 22, 2014 at 9:47 PM, Tejun Heo wrote: > This is not busy wait, the retry and numa_pwq_tbl() guarantee that > the retry will get a new pwq (even without cpu_relax()) as the comments says, Yes, *eventually*. It's not guar

Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-25 Thread Lai Jiangshan
On 05/22/2014 10:21 PM, Lai Jiangshan wrote: > On Thu, May 22, 2014 at 9:47 PM, Tejun Heo wrote: >> On Thu, May 22, 2014 at 04:44:16PM +0800, Lai Jiangshan wrote: >>> When pwq->refcnt == 0, the retrying is guaranteed to make forward-progress. >>> The comment above the code explains it well: >>> >>

Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-22 Thread Lai Jiangshan
On Thu, May 22, 2014 at 9:47 PM, Tejun Heo wrote: > On Thu, May 22, 2014 at 04:44:16PM +0800, Lai Jiangshan wrote: >> When pwq->refcnt == 0, the retrying is guaranteed to make forward-progress. >> The comment above the code explains it well: >> >> /* >>* pwq is determined and locked.

Re: [PATCH] workqueue: remove the unneeded cpu_relax() in __queue_work()

2014-05-22 Thread Tejun Heo
On Thu, May 22, 2014 at 04:44:16PM +0800, Lai Jiangshan wrote: > When pwq->refcnt == 0, the retrying is guaranteed to make forward-progress. > The comment above the code explains it well: > > /* >* pwq is determined and locked. For unbound pools, we could have >* raced with