From: Hou Tao <houtao@huaweicloud.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com, Jeff Layton <jlayton@kernel.org>,
linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Jingbo Xu <jefflexu@linux.alibaba.com>,
houtao1@huawei.com
Subject: Re: [PATCH v2 2/2] fscache: Add the missing smp_mb__after_atomic() before wake_up_bit()
Date: Thu, 12 Jan 2023 09:07:32 +0800 [thread overview]
Message-ID: <cd26e985-ce9a-6011-400a-9005376f47b5@huaweicloud.com> (raw)
In-Reply-To: <2431994.1673453386@warthog.procyon.org.uk>
Hi,
On 1/12/2023 12:09 AM, David Howells wrote:
> Hou Tao <houtao@huaweicloud.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
>
next prev parent reply other threads:[~2023-01-12 1:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-26 10:33 [PATCH v2 0/2] Fixes for fscache volume operations Hou Tao
2022-12-26 10:33 ` [PATCH v2 1/2] fscache: Use wait_on_bit() to wait for the freeing of relinquished volume Hou Tao
2023-01-12 3:47 ` Jingbo Xu
2023-01-12 6:14 ` Hou Tao
2022-12-26 10:33 ` [PATCH v2 2/2] fscache: Add the missing smp_mb__after_atomic() before wake_up_bit() Hou Tao
2023-01-12 4:34 ` Jingbo Xu
2023-01-12 6:17 ` Hou Tao
2023-01-11 4:03 ` [PATCH v2 0/2] Fixes for fscache volume operations Hou Tao
2023-01-11 16:06 ` [PATCH v2 1/2] fscache: Use wait_on_bit() to wait for the freeing of relinquished volume David Howells
2023-01-12 1:05 ` Hou Tao
2023-01-12 3:58 ` Jingbo Xu
2023-01-12 6:12 ` Hou Tao
2023-01-11 16:09 ` [PATCH v2 2/2] fscache: Add the missing smp_mb__after_atomic() before wake_up_bit() David Howells
2023-01-12 1:07 ` Hou Tao [this message]
2023-01-11 16:24 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cd26e985-ce9a-6011-400a-9005376f47b5@huaweicloud.com \
--to=houtao@huaweicloud.com \
--cc=dhowells@redhat.com \
--cc=houtao1@huawei.com \
--cc=jefflexu@linux.alibaba.com \
--cc=jlayton@kernel.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®