Centos-kernel-stream-9/block
Ming Lei 13ac625c0c bdev: use bdev_io_min() for statx block size
JIRA: https://issues.redhat.com/browse/RHEL-88002

commit 425fbcd62d2e1330e64d8d3bf89e554830ba997f
Author: Luis Chamberlain <mcgrof@kernel.org>
Date:   Fri Feb 21 14:38:23 2025 -0800

    bdev: use bdev_io_min() for statx block size

    You can use lsblk to query for a block device block device block size:

    lsblk -o MIN-IO /dev/nvme0n1
    MIN-IO
     4096

    The min-io is the minimum IO the block device prefers for optimal
    performance. In turn we map this to the block device block size.
    The current block size exposed even for block devices with an
    LBA format of 16k is 4k. Likewise devices which support 4k LBA format
    but have a larger Indirection Unit of 16k have an exposed block size
    of 4k.

    This incurs read-modify-writes on direct IO against devices with a
    min-io larger than the page size. To fix this, use the block device
    min io, which is the minimal optimal IO the device prefers.

    With this we now get:

    lsblk -o MIN-IO /dev/nvme0n1
    MIN-IO
     16384

    And so userspace gets the appropriate information it needs for optimal
    performance. This is verified with blkalgn against mkfs against a
    device with LBA format of 4k but an NPWG of 16k (min io size)

    mkfs.xfs -f -b size=16k  /dev/nvme3n1
    blkalgn -d nvme3n1 --ops Write

         Block size          : count     distribution
             0 -> 1          : 0        |                                        |
             2 -> 3          : 0        |                                        |
             4 -> 7          : 0        |                                        |
             8 -> 15         : 0        |                                        |
            16 -> 31         : 0        |                                        |
            32 -> 63         : 0        |                                        |
            64 -> 127        : 0        |                                        |
           128 -> 255        : 0        |                                        |
           256 -> 511        : 0        |                                        |
           512 -> 1023       : 0        |                                        |
          1024 -> 2047       : 0        |                                        |
          2048 -> 4095       : 0        |                                        |
          4096 -> 8191       : 0        |                                        |
          8192 -> 16383      : 0        |                                        |
         16384 -> 32767      : 66       |****************************************|
         32768 -> 65535      : 0        |                                        |
         65536 -> 131071     : 0        |                                        |
        131072 -> 262143     : 2        |*                                       |
    Block size: 14 - 66
    Block size: 17 - 2

         Algn size           : count     distribution
             0 -> 1          : 0        |                                        |
             2 -> 3          : 0        |                                        |
             4 -> 7          : 0        |                                        |
             8 -> 15         : 0        |                                        |
            16 -> 31         : 0        |                                        |
            32 -> 63         : 0        |                                        |
            64 -> 127        : 0        |                                        |
           128 -> 255        : 0        |                                        |
           256 -> 511        : 0        |                                        |
           512 -> 1023       : 0        |                                        |
          1024 -> 2047       : 0        |                                        |
          2048 -> 4095       : 0        |                                        |
          4096 -> 8191       : 0        |                                        |
          8192 -> 16383      : 0        |                                        |
         16384 -> 32767      : 66       |****************************************|
         32768 -> 65535      : 0        |                                        |
         65536 -> 131071     : 0        |                                        |
        131072 -> 262143     : 2        |*                                       |
    Algn size: 14 - 66
    Algn size: 17 - 2

    Reviewed-by: Hannes Reinecke <hare@suse.de>
    Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
    Link: https://lore.kernel.org/r/20250221223823.1680616-9-mcgrof@kernel.org
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Signed-off-by: Christian Brauner <brauner@kernel.org>

Signed-off-by: Ming Lei <ming.lei@redhat.com>
2025-04-22 11:11:32 +08:00
..
partitions block: fix conversion of GPT partition name to 7-bit 2025-03-17 12:51:18 +08:00
Kconfig block: remove the blk_integrity_profile structure 2024-09-27 11:19:05 +08:00
Kconfig.iosched block: Default to use cgroup support for BFQ 2023-03-11 23:27:40 +08:00
Makefile blk-mq: remove unused queue mapping helpers 2025-03-14 16:48:35 +08:00
badblocks.c
bdev.c bdev: use bdev_io_min() for statx block size 2025-04-22 11:11:32 +08:00
bfq-cgroup.c Revert "block, bfq: merge bfq_release_process_ref() into bfq_put_cooperator()" 2024-12-03 16:20:17 +08:00
bfq-iosched.c block, bfq: constify sysfs attributes 2025-03-14 16:48:36 +08:00
bfq-iosched.h block, bfq: remove bfq_log_bfqg() 2024-11-28 17:34:12 +08:00
bfq-wf2q.c block, bfq: inject I/O to underutilized actuators 2023-03-11 23:27:37 +08:00
bio-integrity.c blk-integrity: remove seed for user mapped buffers 2025-03-14 16:48:15 +08:00
bio.c Merge: block: fix adding folio to bio 2025-04-11 14:04:23 -03:00
blk-cgroup-fc-appid.c block: Replace all non-returning strlcpy with strscpy 2023-09-18 15:59:31 +08:00
blk-cgroup-rwstat.c blk-cgroup: use group allocation/free of per-cpu counters API 2024-09-27 11:18:55 +08:00
blk-cgroup-rwstat.h blk-cgroup: rwstat: fix kernel-doc warnings in header file 2025-03-14 16:48:41 +08:00
blk-cgroup.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-cgroup.h blk-cgroup: fix kernel-doc warnings in header file 2025-03-14 16:48:41 +08:00
blk-core.c block: get rid of request queue ->sysfs_dir_lock 2025-03-14 16:48:43 +08:00
blk-crypto-fallback.c block, fs: Restore the per-bio/request data lifetime fields 2025-03-14 16:48:20 +08:00
blk-crypto-internal.h blk-crypto: remove blk_crypto_insert_cloned_request() 2023-09-18 15:56:06 +08:00
blk-crypto-profile.c blk-crypto: use dynamic lock class for blk_crypto_profile::lock 2023-09-18 17:59:21 +08:00
blk-crypto-sysfs.c block: make kobj_type structures constant 2023-03-11 23:27:43 +08:00
blk-crypto.c blk-crypto: Add support for SM4-XTS blk crypto mode 2024-03-26 08:40:56 +08:00
blk-flush.c block: move cache control settings out of queue->flags 2024-09-27 11:19:08 +08:00
blk-ia-ranges.c block: get rid of request queue ->sysfs_dir_lock 2025-03-14 16:48:43 +08:00
blk-integrity.c blk-integrity: remove seed for user mapped buffers 2025-03-14 16:48:15 +08:00
blk-ioc.c block: replace call_rcu by kfree_rcu for simple kmem_cache_free callback 2025-03-14 16:48:12 +08:00
blk-iocost.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-iolatency.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-ioprio.c blk-ioprio: remove per-disk structure 2024-11-28 17:34:10 +08:00
blk-ioprio.h blk-ioprio: remove per-disk structure 2024-11-28 17:34:10 +08:00
blk-lib.c block: fix detection of unsupported WRITE SAME in blkdev_issue_write_zeroes 2024-09-27 11:19:17 +08:00
blk-map.c block: remove blk_rq_bio_prep 2025-03-14 16:48:37 +08:00
blk-merge.c block: make segment size limit workable for > 4K PAGE_SIZE 2025-03-14 16:48:45 +08:00
blk-mq-cpumap.c blk-mq: create correct map for fallback case 2025-03-14 16:48:43 +08:00
blk-mq-debugfs.c block: simplify tag allocation policy selection 2025-03-14 16:48:39 +08:00
blk-mq-debugfs.h block: Replace zone_wlock debugfs entry with zone_wplugs entry 2024-09-27 11:18:57 +08:00
blk-mq-sched.c block: remove BLK_MQ_F_SHOULD_MERGE 2025-03-14 16:48:35 +08:00
blk-mq-sched.h blk-mq: make sure elevator callbacks aren't called for passthrough request 2023-09-18 15:59:28 +08:00
blk-mq-sysfs.c block: fix nr_hw_queue update racing with disk addition/removal 2025-03-14 16:48:43 +08:00
blk-mq-tag.c block: simplify tag allocation policy selection 2025-03-14 16:48:39 +08:00
blk-mq.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-mq.h block: simplify tag allocation policy selection 2025-03-14 16:48:39 +08:00
blk-pm.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-pm.h
blk-rq-qos.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-rq-qos.h block: skip QUEUE_FLAG_STATS and rq-qos for passthrough io 2024-03-07 13:19:58 +08:00
blk-settings.c block: make segment size limit workable for > 4K PAGE_SIZE 2025-03-14 16:48:45 +08:00
blk-stat.c blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW 2024-09-27 11:18:59 +08:00
blk-stat.h block: delete redundant function declaration 2024-09-27 11:19:03 +08:00
blk-sysfs.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-throttle.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
blk-throttle.h blk-throttle: remove last_low_overflow_time 2024-11-28 17:34:12 +08:00
blk-timeout.c
blk-wbt.c blk-wbt: don't throttle swap writes in direct reclaim 2024-09-27 11:19:12 +08:00
blk-wbt.h blk-wbt: remove the separate write cache tracking 2024-03-07 13:19:59 +08:00
blk-zoned.c block: Remove zone write plugs when handling native zone append writes 2025-03-14 16:48:45 +08:00
blk.h block: make segment size limit workable for > 4K PAGE_SIZE 2025-03-14 16:48:45 +08:00
bounce.c block, fs: Restore the per-bio/request data lifetime fields 2025-03-14 16:48:20 +08:00
bsg-lib.c block: remove BLK_MQ_F_NO_SCHED 2025-03-14 16:48:38 +08:00
bsg.c driver core: class: remove module * from class_create() 2023-11-01 11:12:29 -05:00
disk-events.c block: fix kernel-doc for disk_force_media_change() 2024-03-19 10:07:46 +08:00
early-lookup.c wrapper for access to ->bd_partno 2025-03-14 16:48:08 +08:00
elevator.c block: force noio scope in blk_mq_freeze_queue 2025-03-14 16:48:44 +08:00
elevator.h elevator: Enable const sysfs attributes 2025-03-14 16:48:36 +08:00
fops.c block: don't revert iter for -EIOCBQUEUED 2025-03-14 16:48:42 +08:00
genhd.c block: limit disk max sectors to (LLONG_MAX >> 9) 2025-03-14 16:48:42 +08:00
holder.c block: fix deadlock between bd_link_disk_holder and partition scan 2024-05-07 11:23:05 +08:00
ioctl.c bdev: move ->bd_read_only to ->__bd_flags 2025-03-14 16:48:08 +08:00
ioprio.c block: move __get_task_ioprio() into header file 2024-09-27 11:18:32 +08:00
kyber-iosched.c kyber: constify sysfs attributes 2025-03-14 16:48:36 +08:00
mq-deadline.c block: mq-deadline: Constify sysfs attributes 2025-03-14 16:48:36 +08:00
opal_proto.h block: sed-opal: handle empty atoms when parsing response 2024-03-07 13:20:01 +08:00
sed-opal.c block: sed-opal: add ioctl IOC_OPAL_SET_SID_PW 2024-12-09 16:15:56 +08:00
t10-pi.c block: constify ext_pi_ref_escape() 2024-11-28 17:34:11 +08:00