drivers/char/mem: splice the zero page for /dev/zero and /dev/full
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v11 patch 2 repliesSuperseded
Changes in v2 from the cover letter
- Move zero_pipe_buf_ops and splice_zeropage_into_pipe() from mm/shmem.c into fs/splice.c so they can be shared, instead of duplicating the boilerplate (Max Kellermann's suggestion).
- Rework splice_read_zero() to use the shared helper.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | fs: move splice_zeropage_into_pipe() and zero_pipe_buf_ops to fs/splice.cfs/ include/ mm/ | +65 | 0 replies | |
| 2/2 | drivers/char/mem: splice the zero page for /dev/zero and /dev/fulldrivers/ | +27 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Max Kellermann |
|---|---|
| 1/2 | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] drivers/char/mem: splice the zero page for /dev/zero and /dev/full
Commit 1b057bd800c3 ("drivers/char/mem: implement splice() for /dev/zero, /dev/full") added splice support to /dev/zero and /dev/full using copy_splice_read(). The author noted that this could be optimized by pushing references to the global zero page instead of allocating and zeroing fresh pages for every pipe buffer, deferring it as "an optimization for another day".
This series implements that optimization by splicing the zero page into the pipe for /dev/zero and /dev/full, reusing the existing zero-page splice logic from mm/shmem.c.
v2:
- Move zero_pipe_buf_ops and splice_zeropage_into_pipe() from mm/shmem.c into fs/splice.c so they can be shared, instead of duplicating the boilerplate (Max Kellermann's suggestion).
- Rework splice_read_zero() to use the shared helper.
Kris Pan (2):
fs: move splice_zeropage_into_pipe() and zero_pipe_buf_ops to
fs/splice.c
drivers/char/mem: splice the zero page for /dev/zero and /dev/full
drivers/char/mem.c | 29 ++++++++++++++++++-- fs/splice.c | 62 ++++++++++++++++++++++++++++++++++++++++++ include/linux/splice.h | 3 ++ mm/shmem.c | 45 ------------------------------ 4 files changed, 92 insertions(+), 47 deletions(-)
Signature · 1 line
2.43.0