[PATCH 06/10] netfs: Remove redundant use of smp_rmb()
Akira Yokosawa
akiyks at gmail.com
Mon Dec 16 21:13:39 AEDT 2024
David Howells wrote:
> From: Zilin Guan <zilin at seu.edu.cn>
>
> The function netfs_unbuffered_write_iter_locked() in
> fs/netfs/direct_write.c contains an unnecessary smp_rmb() call after
> wait_on_bit(). Since wait_on_bit() already incorporates a memory barrier
> that ensures the flag update is visible before the function returns, the
> smp_rmb() provides no additional benefit and incurs unnecessary overhead.
>
> This patch removes the redundant barrier to simplify and optimize the code.
>
> Signed-off-by: Zilin Guan <zilin at seu.edu.cn>
> Signed-off-by: David Howells <dhowells at redhat.com>
> cc: Akira Yokosawa <akiyks at gmail.com>
Reviewed-by: Akira Yokosawa <akiyks at gmail.com>
> cc: Jeff Layton <jlayton at kernel.org>
> cc: netfs at lists.linux.dev
> cc: linux-fsdevel at vger.kernel.org
> Link: https://lore.kernel.org/r/20241207021952.2978530-1-zilin@seu.edu.cn/
> ---
> fs/netfs/direct_write.c | 1 -
> 1 file changed, 1 deletion(-)
>
More information about the Linux-erofs
mailing list