From: Kris Pan <kris.pan@intel.com>
To: gregkh@linuxfoundation.org
Cc: akpm@linux-foundation.org, hughd@google.com,
viro@zeniv.linux.org.uk, brauner@kernel.org, arnd@arndb.de,
max.kellermann@ionos.com, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kris Pan <kris.pan@intel.com>
Subject: [PATCH v2 0/2] drivers/char/mem: splice the zero page for /dev/zero and /dev/full
Date: Sat, 29 Aug 2026 12:37:44 +0800 [thread overview]
Message-ID: <20260829043746.2929210-1-kris.pan@intel.com> (raw)
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(-)
--
2.43.0
next reply other threads:[~2026-08-29 4:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 4:37 Kris Pan [this message]
2026-08-29 4:37 ` [PATCH v2 1/2] fs: move splice_zeropage_into_pipe() and zero_pipe_buf_ops to fs/splice.c Kris Pan
2026-08-29 4:37 ` [PATCH v2 2/2] drivers/char/mem: splice the zero page for /dev/zero and /dev/full Kris Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260829043746.2929210-1-kris.pan@intel.com \
--to=kris.pan@intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=max.kellermann@ionos.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®