The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL 11/16 for v7.2] vfs bh
Date: Fri, 12 Jun 2026 17:14:35 +0200	[thread overview]
Message-ID: <20260612-vfs-bh-v72-d55cbf8fd827@brauner> (raw)
In-Reply-To: <20260612-vfs-v72-20facee87e19@brauner>

Hey Linus,

/* Summary */

This removes b_end_io from struct buffer_head.

Instead of setting bio->bi_end_io to end_bio_bh_io_sync() which then
calls bh->b_end_io(), the new bh_submit() and __bh_submit() interfaces
set bio->bi_end_io to the appropriate completion handler directly,
replacing two indirect function calls in the completion path with one.
It is also one fewer function pointer in the middle of a writable data
structure that can be corrupted, it shrinks struct buffer_head from
104 to 96 bytes allowing roughly 7% more buffer_heads to be cached in
the same amount of memory, and it removes some atomic operations as
the buffer refcount is no longer incremented before calling the end_io
handler.

All in-tree users (fs/buffer.c itself, ext4, jbd2, ocfs2, gfs2,
nilfs2, and md-bitmap) are converted, and submit_bh(),
mark_buffer_async_write(), and end_buffer_write_sync() are removed.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3+b1)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:

  Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.2-rc1.bh

for you to fetch changes up to f0d857543e4d37464759c338f46ad6c85a618a2e:

  Merge patch series "Remove b_end_io from struct buffer_head" (2026-06-04 10:28:17 +0200)

----------------------------------------------------------------
vfs-7.2-rc1.bh

Please consider pulling these changes from the signed vfs-7.2-rc1.bh tag.

Thanks!
Christian

----------------------------------------------------------------
Christian Brauner (1):
      Merge patch series "Remove b_end_io from struct buffer_head"

Matthew Wilcox (Oracle) (34):
      buffer: Remove forward declaration of submit_bh_wbc()
      buffer: Add bh_submit()
      buffer: Remove mark_buffer_async_write_endio()
      buffer: Add bh_end_read(), bh_end_write() and bh_end_async_write()
      buffer: Convert write_dirty_buffer to bh_submit()
      buffer: Convert __bread_slow to bh_submit()
      buffer: Convert __sync_dirty_buffer to bh_submit()
      buffer: Convert __bh_read to bh_submit()
      buffer: Convert __bh_read_batch to bh_submit()
      buffer: Convert block_read_full_folio to bh_submit()
      buffer: Convert __block_write_full_folio to __bh_submit()
      ext4; Convert __ext4_read_bh() to bh_submit()
      ext4: Convert ext4_fc_submit_bh() to bh_submit()
      ext4: Convert write_mmp_block_thawed() to bh_submit()
      ext4: Convert ext4_commit_super() to bh_submit()
      jbd2: Convert journal commit to bh_submit()
      jbd2: Convert jbd2_write_superblock() to bh_submit()
      ocfs2: Convert ocfs2_write_block to bh_submit()
      ocfs2: Convert ocfs2_read_block to bh_submit()
      ocfs2: Convert ocfs2_read_blocks to bh_submit()
      ocfs2: Convert ocfs2_write_super_or_backup to bh_submit()
      gfs2: Convert gfs2_metapath_ra to bh_submit()
      gfs2: Convert gfs2_dir_readahead to bh_submit()
      gfs2: Remove use of b_end_io in gfs2_meta_read_endio()
      gfs2: Convert gfs2_aspace_write_folio to bh_submit()
      buffer: Remove mark_buffer_async_write()
      nilfs2: Convert nilfs_btnode_submit_block to bh_submit()
      nilfs2: Convert nilfs_gccache_submit_read_data to bh_submit()
      nilfs2: Convert nilfs_mdt_submit_block to bh_submit()
      md-bitmap: Convert read_file_page and write_file_page to bh_submit()
      buffer: Remove submit_bh()
      buffer: Remove b_end_io
      buffer: Change calling convention for end_buffer_read_sync()
      buffer: Remove end_buffer_write_sync()

 Documentation/filesystems/locking.rst |  14 --
 Documentation/trace/ftrace.rst        |   4 +-
 drivers/md/md-bitmap.c                |  27 +--
 drivers/md/raid5.h                    |   6 +-
 fs/buffer.c                           | 385 ++++++++++++++++++----------------
 fs/ext4/ext4.h                        |  10 +-
 fs/ext4/fast_commit.c                 |   8 +-
 fs/ext4/ialloc.c                      |   6 +-
 fs/ext4/mmp.c                         |   5 +-
 fs/ext4/super.c                       |  18 +-
 fs/gfs2/bmap.c                        |  13 +-
 fs/gfs2/dir.c                         |  12 +-
 fs/gfs2/meta_io.c                     |  13 +-
 fs/jbd2/commit.c                      |  13 +-
 fs/jbd2/journal.c                     |   4 +-
 fs/nilfs2/btnode.c                    |   4 +-
 fs/nilfs2/gcinode.c                   |   4 +-
 fs/nilfs2/mdt.c                       |   4 +-
 fs/ocfs2/buffer_head_io.c             |  16 +-
 include/linux/buffer_head.h           |  16 +-
 mm/vmscan.c                           |   2 +-
 21 files changed, 288 insertions(+), 296 deletions(-)

  parent reply	other threads:[~2026-06-12 15:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 15:10 [GIT PULL 00/16 for v7.2] v7.2 Christian Brauner
2026-06-12 15:11 ` [GIT PULL 01/16 for v7.2] vfs kfunc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:11 ` [GIT PULL 02/16 for v7.2] vfs exportfs Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:12 ` [GIT PULL 03/16 for v7.2] vfs inode Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:12 ` [GIT PULL 04/16 for v7.2] vfs directory delegations Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:12 ` [GIT PULL 05/16 for v7.2] vfs casefold Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 06/16 for v7.2] kernel task_exec_state Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 07/16 for v7.2] kernel misc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:13 ` [GIT PULL 08/16 for v7.2] vfs openat2 Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` [GIT PULL 09/16 for v7.2] vfs super Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` [GIT PULL 10/16 for v7.2] vfs writeback Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:14 ` Christian Brauner [this message]
2026-06-15  3:45   ` [GIT PULL 11/16 for v7.2] vfs bh pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 12/16 for v7.2] vfs eventpoll Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 13/16 for v7.2] vfs iomap Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:15 ` [GIT PULL 14/16 for v7.2] vfs xattr Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:16 ` [GIT PULL 15/16 for v7.2] vfs misc Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot
2026-06-12 15:16 ` [GIT PULL 16/16 for v7.2] vfs procfs Christian Brauner
2026-06-15  3:45   ` pr-tracker-bot

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=20260612-vfs-bh-v72-d55cbf8fd827@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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