Re: [PATCH vfs.all 22/26] block: stash a bdev_file to read/write raw blcok_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

在 2024/04/11 22:49, Al Viro 写道:
On Thu, Apr 11, 2024 at 03:04:09PM +0100, Al Viro wrote:
lot slimmer and we don't need to care about messing with a lot of that
code. I didn't care about making it static inline because that might've
meant we need to move other stuff into the header as well. Imho, it's
not that important but if it's a big deal to any of you just do the
changes on top of it, please.

Pushed to
https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.super

If I hear no objections that'll show up in -next tomorrow. Al, would be
nice if you could do your changes on top of this, please.

Objection: start with adding bdev->bd_mapping, next convert the really
obvious instances to it and most of this series becomes not needed at
all.

Really.  There is no need whatsoever to push struct file down all those
paths.


There really is a long history here. The beginning of the attempt to try
removing the filed 'bd_inode' is that I want to make a room from the
first cacheline(64 bytes) for a new 'unsigned long flags' field because
we keep adding new 'bool xxx' field [1]. And adding a new 'bd_mapping'
field will make that impossible.

I do like the idea of passing 'bd_mapping' here, however, will it be
considered to expose bdev_mapping() for slow path, or to pass in bd_file
and get it by 'f_mapping' for fast path? So that a new field in the
first cacheline will still be possible, other than that there will be
more code change, I don't see any difference for performance.

Thanks,
Kuai

[1] https://lore.kernel.org/all/20231122103103.1104589-3-yukuai1@xxxxxxxxxxxxxxx/
And yes, erofs and buffer.c stuff belongs on top of that, no arguments here.

FWIW, here's what you get if this is done in such order:

block/bdev.c                           | 31 ++++++++++++++++++++++---------
block/blk-zoned.c                      |  4 ++--
block/fops.c                           |  4 ++--
block/genhd.c                          |  2 +-
block/ioctl.c                          | 14 ++++++--------
block/partitions/core.c                |  2 +-
drivers/md/bcache/super.c              |  2 +-
drivers/md/dm-vdo/dm-vdo-target.c      |  4 ++--
drivers/md/dm-vdo/indexer/io-factory.c |  2 +-
drivers/mtd/devices/block2mtd.c        |  6 ++++--
drivers/scsi/scsicam.c                 |  2 +-
fs/bcachefs/util.h                     |  5 -----
fs/btrfs/disk-io.c                     |  6 +++---
fs/btrfs/volumes.c                     |  2 +-
fs/btrfs/zoned.c                       |  2 +-
fs/buffer.c                            | 10 +++++-----
fs/cramfs/inode.c                      |  2 +-
fs/ext4/dir.c                          |  2 +-
fs/ext4/ext4_jbd2.c                    |  2 +-
fs/ext4/super.c                        | 24 +++---------------------
fs/gfs2/glock.c                        |  2 +-
fs/gfs2/ops_fstype.c                   |  2 +-
fs/jbd2/journal.c                      |  2 +-
include/linux/blk_types.h              |  1 +
include/linux/blkdev.h                 | 12 ++----------
include/linux/buffer_head.h            |  4 ++--
include/linux/jbd2.h                   |  4 ++--
27 files changed, 69 insertions(+), 86 deletions(-)

The bulk of the changes is straight replacements of foo->bd_inode->i_mapping
with foo->bd_mapping.  That's completely mechanical and that takes out most
of the bd_inode uses.  Anyway, patches in followups

.






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux