All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nfs: refactor bit operations using clear_and_wake_up_bit
@ 2026-06-22 17:55 Arnaud Bonnet
  2026-06-22 17:55 ` [PATCH 1/2] nfs: replace atomic bitops sequence with clear_and_wake_up_bit helper Arnaud Bonnet
  2026-06-22 17:55 ` [PATCH 2/2] nfs: refactor pNFS functions using clear_and_wake_up_bit Arnaud Bonnet
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaud Bonnet @ 2026-06-22 17:55 UTC (permalink / raw)
  To: trondmy, anna
  Cc: linux-nfs, linux-kernel, code, skhan, me, jkoolstra,
	Arnaud Bonnet

Several functions in nfs code use the exact following sequence of calls
when dealing with flags:
	
	clear_bit_unlock();
	smp_mb__after_atomic();
	wake_up_bit();

Since commit 8236b0ae31c8 ("bdi: wake up concurrent wb_shutdown()
callers.") came the helper clear_and_wake_up_bit() for this exact
purpose, and has since been adopted by several subsystems, including
vfs.

This function is already used in files such as nfs4state.c and
pnfs_nfs.c and this serie aims to continue this effort, which also
allows to remove some no longer used code.

Tested on x86 hardware using a loopback pNFS SCSI layout:
* doing image compression/decompression using xz and
* recompiling tinyconfig kernels on the remounted partition
No error reported under sanitizers.

Suggested-by: Agatha Isabelle Moreira <code@agatha.dev>
Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_007
Signed-off-by: Arnaud Bonnet <abo@medichon.fr>
---

Arnaud Bonnet (2):
  nfs: replace atomic bitops sequence with clear_and_wake_up_bit helper
  nfs: refactor pNFS functions using clear_and_wake_up_bit

 fs/nfs/inode.c |  4 +---
 fs/nfs/pnfs.c  | 35 ++++++++++-------------------------
 2 files changed, 11 insertions(+), 28 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-22 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 17:55 [PATCH 0/2] nfs: refactor bit operations using clear_and_wake_up_bit Arnaud Bonnet
2026-06-22 17:55 ` [PATCH 1/2] nfs: replace atomic bitops sequence with clear_and_wake_up_bit helper Arnaud Bonnet
2026-06-22 17:55 ` [PATCH 2/2] nfs: refactor pNFS functions using clear_and_wake_up_bit Arnaud Bonnet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.