lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9cc62b69-7cfb-477b-bec1-3bbcc49a310e@gmail.com>
Date: Sat, 7 Dec 2024 19:09:59 +0900
From: Akira Yokosawa <akiyks@...il.com>
To: David Howells <dhowells@...hat.com>
Cc: zilin@....edu.cn, jianhao.xu@....edu.cn, jlayton@...nel.org,
 linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
 netfs@...ts.linux.dev, mjguzik@...il.com
Subject: Re: [PATCH] fs/netfs: Remove redundant use of smp_rmb()

Hi David,

On Sat, 07 Dec 2024 08:04:56 +0000, David Howells wrote:
> Akira Yokosawa <akiyks@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ