mbox series

[v2,0/4] pipe: Trivial cleanups

Message ID 20250307052919.34542-1-kprateek.nayak@amd.com (mailing list archive)
Headers show
Series pipe: Trivial cleanups | expand

Message

K Prateek Nayak March 7, 2025, 5:29 a.m. UTC
Hello folks,

Based on the suggestion on the RFC, the treewide conversion of
references to pipe->{head,tail} from unsigned int to pipe_index_t has
been dropped for now. The series contains trivial cleanup suggested to
limit the nr_slots in pipe_resize_ring() to be covered between
pipe_index_t limits of pipe->{head,tail} and using pipe_buf() to remove
the open-coded usage of masks to access pipe buffer building on Linus'
cleanup of fs/fuse/dev.c in commit ebb0f38bb47f ("fs/pipe: fix pipe
buffer index use in FUSE")

If folks are interested in converting a selective subset of references
to pipe->{head,tail} from unsigned int to pipe_index_t, please comment
on
https://lore.kernel.org/all/20250306113924.20004-4-kprateek.nayak@amd.com/
and I can send out a patch or you can go ahead and send one out yourself
too :)

Changes are based on Linus' tree at commit 00a7d39898c8 ("fs/pipe: add
simpler helpers for common cases")

---
Changelog:

RFC v1..v2:

o Dropped the RFC tag.

o Use (piep_index_t)-1u as the upper limit for nr_slots replacing the
  BITS_PER_TYPE() hackery to get the limits (Oleg; Patch 1)

o Patch 2 from the RFC v1 was dropped as it became redundand after the
  introduction of pipe_is_full() helper.

o Patch 2-4 are additional cleanups introduced in this version to use
  pipe_buf() replacing all the open-coded logic in various subsystems.
  (Oleg; Patch 2-4)

RFC: https://lore.kernel.org/all/20250306113924.20004-1-kprateek.nayak@amd.com/
---
K Prateek Nayak (4):
  fs/pipe: Limit the slots in pipe_resize_ring()
  kernel/watch_queue: Use pipe_buf() to retrieve the pipe buffer
  fs/pipe: Use pipe_buf() helper to retrieve pipe buffer
  fs/splice: Use pipe_buf() helper to retrieve pipe buffer

 fs/pipe.c            | 13 +++++++------
 fs/splice.c          | 40 ++++++++++++++--------------------------
 kernel/watch_queue.c |  7 +++----
 3 files changed, 24 insertions(+), 36 deletions(-)


base-commit: 00a7d39898c8010bfd5ff62af31ca5db34421b38

Comments

Christian Brauner March 10, 2025, 7:59 a.m. UTC | #1
On Fri, 07 Mar 2025 05:29:15 +0000, K Prateek Nayak wrote:
> Based on the suggestion on the RFC, the treewide conversion of
> references to pipe->{head,tail} from unsigned int to pipe_index_t has
> been dropped for now. The series contains trivial cleanup suggested to
> limit the nr_slots in pipe_resize_ring() to be covered between
> pipe_index_t limits of pipe->{head,tail} and using pipe_buf() to remove
> the open-coded usage of masks to access pipe buffer building on Linus'
> cleanup of fs/fuse/dev.c in commit ebb0f38bb47f ("fs/pipe: fix pipe
> buffer index use in FUSE")
> 
> [...]

Applied to the vfs-6.15.pipe branch of the vfs/vfs.git tree.
Patches in the vfs-6.15.pipe branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.15.pipe

[1/4] fs/pipe: Limit the slots in pipe_resize_ring()
      https://git.kernel.org/vfs/vfs/c/cf3d0c54b21c
[2/4] kernel/watch_queue: Use pipe_buf() to retrieve the pipe buffer
      https://git.kernel.org/vfs/vfs/c/547476063e12
[3/4] fs/pipe: Use pipe_buf() helper to retrieve pipe buffer
      https://git.kernel.org/vfs/vfs/c/ba0822021c3c
[4/4] fs/splice: Use pipe_buf() helper to retrieve pipe buffer
      https://git.kernel.org/vfs/vfs/c/d5c6cb01b69c