Re: [PATCH] slow_work_execute() needs mb() beforetest_bit(SLOW_WORK_PENDING)

From: Oleg Nesterov
Date: Thu Apr 16 2009 - 10:19:36 EST


On 04/16, David Howells wrote:
>
> Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > But why do we need the barrier before clear_bit(SLOW_WORK_EXECUTING) ?
> > We do have one after test_and_clear_bit(SLOW_WORK_PENDING) above, and it
> > should be enough, no?
>
> No. There lock is covering work->ops->execute(work) too, and that is after
> the clearance of SLOW_WORK_PENDING. The UNLOCK-class barrier must go between
> execution and clearance of the execution lock bit.

Ah. Now I see.

It is still not clear to me whether we need a barrier after clear_bit_unlock.

Thanks David!

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/