[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd26e985-ce9a-6011-400a-9005376f47b5@huaweicloud.com>
Date: Thu, 12 Jan 2023 09:07:32 +0800
From: Hou Tao <houtao@...weicloud.com>
To: David Howells <dhowells@...hat.com>
Cc: linux-cachefs@...hat.com, Jeff Layton <jlayton@...nel.org>,
linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Jingbo Xu <jefflexu@...ux.alibaba.com>, houtao1@...wei.com
Subject: Re: [PATCH v2 2/2] fscache: Add the missing smp_mb__after_atomic()
before wake_up_bit()
Hi,
On 1/12/2023 12:09 AM, David Howells wrote:
> Hou Tao <houtao@...weicloud.com> wrote:
>
>> fscache_create_volume_work() uses wake_up_bit() to wake up the processes
>> which are waiting for the completion of volume creation. According to
>> comments in wake_up_bit() and waitqueue_active(), an extra smp_mb() is
>> needed to guarantee the memory order between FSCACHE_VOLUME_CREATING
>> flag and waitqueue_active() before invoking wake_up_bit().
> What two values are you ordering?
>
> If we're using this to create a critical section, then yes, we would need a
> barrier to order the changes inside the critical section before changing the
> memory location that forms the lock - but this is not a critical section.
It is similar with patch #1. The smp_mb() is used for order between
volume->flags and wq->head.
> David
>
Powered by blists - more mailing lists