netfs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: zilin@seu.edu.cn, jianhao.xu@seu.edu.cn, jlayton@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	netfs@lists.linux.dev, mjguzik@gmail.com
Subject: Re: [PATCH] fs/netfs: Remove redundant use of smp_rmb()
Date: Sat, 7 Dec 2024 19:09:59 +0900	[thread overview]
Message-ID: <9cc62b69-7cfb-477b-bec1-3bbcc49a310e@gmail.com> (raw)
In-Reply-To: <2011011.1733558696@warthog.procyon.org.uk>

Hi David,

On Sat, 07 Dec 2024 08:04:56 +0000, David Howells wrote:
> Akira Yokosawa <akiyks@gmail.com> wrote:
> 
>> Are you sure removing the smp_rmb() is realy the right thing to do?
> 
> The wait_on_bit*() class functions, e.g.:
> 
> 	wait_on_bit(unsigned long *word, int bit, unsigned mode)
> 	{
> 		might_sleep();
> 		if (!test_bit_acquire(bit, word))
> 			return 0;
> 		return out_of_line_wait_on_bit(word, bit,
> 					       bit_wait,
> 					       mode);
> 	}
> 
> now unconditionally includes an appropriate barrier on the test_bit(), so the
> smp_rmb() should be unnecessary, though netfslib should probably be using
> clear_and_wake_up_bit().
> 

Thank you for clarifying.

> Probably we need to update the doc to reflect this.

Agreed.

I see that wait_on_bit()'s kernel-doc comment mentions implicit ACQUIRE
semantics on success, and that of wake_up_bit() mentions the need of care
for memory ordering before calling it.

Unfortunately, neither of those comments is included into kernel
documentation build (Sphinx) at the moment.

I'm going to prepare a patch for including them somewhere under the
core-api doc.

WRT memory-barriers.txt, I'm not sure I can update it properly.

David, may I ask you doing that part?

Thanks, Akira


      reply	other threads:[~2024-12-07 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07  2:19 [PATCH] fs/netfs: Remove redundant use of smp_rmb() Zilin Guan
2024-12-07  5:20 ` Akira Yokosawa
2024-12-07  8:04 ` David Howells
2024-12-07 10:09   ` Akira Yokosawa [this message]

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=9cc62b69-7cfb-477b-bec1-3bbcc49a310e@gmail.com \
    --to=akiyks@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=netfs@lists.linux.dev \
    --cc=zilin@seu.edu.cn \
    /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;
as well as URLs for NNTP newsgroup(s).