Skip to content

Commit 6f59de9

Browse files
committed
Merge tag 'for-6.16/block-20250523' of git://git.kernel.dk/linux
Pull block updates from Jens Axboe: - ublk updates: - Add support for updating the size of a ublk instance - Zero-copy improvements - Auto-registering of buffers for zero-copy - Series simplifying and improving GET_DATA and request lookup - Series adding quiesce support - Lots of selftests additions - Various cleanups - NVMe updates via Christoph: - add per-node DMA pools and use them for PRP/SGL allocations (Caleb Sander Mateos, Keith Busch) - nvme-fcloop refcounting fixes (Daniel Wagner) - support delayed removal of the multipath node and optionally support the multipath node for private namespaces (Nilay Shroff) - support shared CQs in the PCI endpoint target code (Wilfred Mallawa) - support admin-queue only authentication (Hannes Reinecke) - use the crc32c library instead of the crypto API (Eric Biggers) - misc cleanups (Christoph Hellwig, Marcelo Moreira, Hannes Reinecke, Leon Romanovsky, Gustavo A. R. Silva) - MD updates via Yu: - Fix that normal IO can be starved by sync IO, found by mkfs on newly created large raid5, with some clean up patches for bdev inflight counters - Clean up brd, getting rid of atomic kmaps and bvec poking - Add loop driver specifically for zoned IO testing - Eliminate blk-rq-qos calls with a static key, if not enabled - Improve hctx locking for when a plug has IO for multiple queues pending - Remove block layer bouncing support, which in turn means we can remove the per-node bounce stat as well - Improve blk-throttle support - Improve delay support for blk-throttle - Improve brd discard support - Unify IO scheduler switching. This should also fix a bunch of lockdep warnings we've been seeing, after enabling lockdep support for queue freezing/unfreezeing - Add support for block write streams via FDP (flexible data placement) on NVMe - Add a bunch of block helpers, facilitating the removal of a bunch of duplicated boilerplate code - Remove obsolete BLK_MQ pci and virtio Kconfig options - Add atomic/untorn write support to blktrace - Various little cleanups and fixes * tag 'for-6.16/block-20250523' of git://git.kernel.dk/linux: (186 commits) selftests: ublk: add test for UBLK_F_QUIESCE ublk: add feature UBLK_F_QUIESCE selftests: ublk: add test case for UBLK_U_CMD_UPDATE_SIZE traceevent/block: Add REQ_ATOMIC flag to block trace events ublk: run auto buf unregisgering in same io_ring_ctx with registering io_uring: add helper io_uring_cmd_ctx_handle() ublk: remove io argument from ublk_auto_buf_reg_fallback() ublk: handle ublk_set_auto_buf_reg() failure correctly in ublk_fetch() selftests: ublk: add test for covering UBLK_AUTO_BUF_REG_FALLBACK selftests: ublk: support UBLK_F_AUTO_BUF_REG ublk: support UBLK_AUTO_BUF_REG_FALLBACK ublk: register buffer to local io_uring with provided buf index via UBLK_F_AUTO_BUF_REG ublk: prepare for supporting to register request buffer automatically ublk: convert to refcount_t selftests: ublk: make IO & device removal test more stressful nvme: rename nvme_mpath_shutdown_disk to nvme_mpath_remove_disk nvme: introduce multipath_always_on module param nvme-multipath: introduce delayed removal of the multipath head node nvme-pci: derive and better document max segments limits nvme-pci: use struct_size for allocation struct nvme_dev ...
2 parents 3e40674 + 533c87e commit 6f59de9

File tree

129 files changed

+5491
-2470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5491
-2470
lines changed

Documentation/ABI/stable/sysfs-block

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,21 @@ Description:
547547
[RO] Maximum size in bytes of a single element in a DMA
548548
scatter/gather list.
549549

550+
What: /sys/block/<disk>/queue/max_write_streams
551+
Date: November 2024
552+
553+
Description:
554+
[RO] Maximum number of write streams supported, 0 if not
555+
supported. If supported, valid values are 1 through
556+
max_write_streams, inclusive.
557+
558+
What: /sys/block/<disk>/queue/write_stream_granularity
559+
Date: November 2024
560+
561+
Description:
562+
[RO] Granularity of a write stream in bytes. The granularity
563+
of a write stream is the size that should be discarded or
564+
overwritten together to avoid write amplification in the device.
550565

551566
What: /sys/block/<disk>/queue/max_segments
552567
Date: March 2010

Documentation/admin-guide/blockdev/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Block Devices
1111
nbd
1212
paride
1313
ramdisk
14+
zoned_loop
1415
zram
1516

1617
drbd/index
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=======================
4+
Zoned Loop Block Device
5+
=======================
6+
7+
.. Contents:
8+
9+
1) Overview
10+
2) Creating a Zoned Device
11+
3) Deleting a Zoned Device
12+
4) Example
13+
14+
15+
1) Overview
16+
-----------
17+
18+
The zoned loop block device driver (zloop) allows a user to create a zoned block
19+
device using one regular file per zone as backing storage. This driver does not
20+
directly control any hardware and uses read, write and truncate operations to
21+
regular files of a file system to emulate a zoned block device.
22+
23+
Using zloop, zoned block devices with a configurable capacity, zone size and
24+
number of conventional zones can be created. The storage for each zone of the
25+
device is implemented using a regular file with a maximum size equal to the zone
26+
size. The size of a file backing a conventional zone is always equal to the zone
27+
size. The size of a file backing a sequential zone indicates the amount of data
28+
sequentially written to the file, that is, the size of the file directly
29+
indicates the position of the write pointer of the zone.
30+
31+
When resetting a sequential zone, its backing file size is truncated to zero.
32+
Conversely, for a zone finish operation, the backing file is truncated to the
33+
zone size. With this, the maximum capacity of a zloop zoned block device created
34+
can be larger configured to be larger than the storage space available on the
35+
backing file system. Of course, for such configuration, writing more data than
36+
the storage space available on the backing file system will result in write
37+
errors.
38+
39+
The zoned loop block device driver implements a complete zone transition state
40+
machine. That is, zones can be empty, implicitly opened, explicitly opened,
41+
closed or full. The current implementation does not support any limits on the
42+
maximum number of open and active zones.
43+
44+
No user tools are necessary to create and delete zloop devices.
45+
46+
2) Creating a Zoned Device
47+
--------------------------
48+
49+
Once the zloop module is loaded (or if zloop is compiled in the kernel), the
50+
character device file /dev/zloop-control can be used to add a zloop device.
51+
This is done by writing an "add" command directly to the /dev/zloop-control
52+
device::
53+
54+
$ modprobe zloop
55+
$ ls -l /dev/zloop*
56+
crw-------. 1 root root 10, 123 Jan 6 19:18 /dev/zloop-control
57+
58+
$ mkdir -p <base directory/<device ID>
59+
$ echo "add [options]" > /dev/zloop-control
60+
61+
The options available for the add command can be listed by reading the
62+
/dev/zloop-control device::
63+
64+
$ cat /dev/zloop-control
65+
add id=%d,capacity_mb=%u,zone_size_mb=%u,zone_capacity_mb=%u,conv_zones=%u,base_dir=%s,nr_queues=%u,queue_depth=%u,buffered_io
66+
remove id=%d
67+
68+
In more details, the options that can be used with the "add" command are as
69+
follows.
70+
71+
================ ===========================================================
72+
id Device number (the X in /dev/zloopX).
73+
Default: automatically assigned.
74+
capacity_mb Device total capacity in MiB. This is always rounded up to
75+
the nearest higher multiple of the zone size.
76+
Default: 16384 MiB (16 GiB).
77+
zone_size_mb Device zone size in MiB. Default: 256 MiB.
78+
zone_capacity_mb Device zone capacity (must always be equal to or lower than
79+
the zone size. Default: zone size.
80+
conv_zones Total number of conventioanl zones starting from sector 0.
81+
Default: 8.
82+
base_dir Path to the base directoy where to create the directory
83+
containing the zone files of the device.
84+
Default=/var/local/zloop.
85+
The device directory containing the zone files is always
86+
named with the device ID. E.g. the default zone file
87+
directory for /dev/zloop0 is /var/local/zloop/0.
88+
nr_queues Number of I/O queues of the zoned block device. This value is
89+
always capped by the number of online CPUs
90+
Default: 1
91+
queue_depth Maximum I/O queue depth per I/O queue.
92+
Default: 64
93+
buffered_io Do buffered IOs instead of direct IOs (default: false)
94+
================ ===========================================================
95+
96+
3) Deleting a Zoned Device
97+
--------------------------
98+
99+
Deleting an unused zoned loop block device is done by issuing the "remove"
100+
command to /dev/zloop-control, specifying the ID of the device to remove::
101+
102+
$ echo "remove id=X" > /dev/zloop-control
103+
104+
The remove command does not have any option.
105+
106+
A zoned device that was removed can be re-added again without any change to the
107+
state of the device zones: the device zones are restored to their last state
108+
before the device was removed. Adding again a zoned device after it was removed
109+
must always be done using the same configuration as when the device was first
110+
added. If a zone configuration change is detected, an error will be returned and
111+
the zoned device will not be created.
112+
113+
To fully delete a zoned device, after executing the remove operation, the device
114+
base directory containing the backing files of the device zones must be deleted.
115+
116+
4) Example
117+
----------
118+
119+
The following sequence of commands creates a 2GB zoned device with zones of 64
120+
MB and a zone capacity of 63 MB::
121+
122+
$ modprobe zloop
123+
$ mkdir -p /var/local/zloop/0
124+
$ echo "add capacity_mb=2048,zone_size_mb=64,zone_capacity=63MB" > /dev/zloop-control
125+
126+
For the device created (/dev/zloop0), the zone backing files are all created
127+
under the default base directory (/var/local/zloop)::
128+
129+
$ ls -l /var/local/zloop/0
130+
total 0
131+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000000
132+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000001
133+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000002
134+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000003
135+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000004
136+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000005
137+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000006
138+
-rw-------. 1 root root 67108864 Jan 6 22:23 cnv-000007
139+
-rw-------. 1 root root 0 Jan 6 22:23 seq-000008
140+
-rw-------. 1 root root 0 Jan 6 22:23 seq-000009
141+
...
142+
143+
The zoned device created (/dev/zloop0) can then be used normally::
144+
145+
$ lsblk -z
146+
NAME ZONED ZONE-SZ ZONE-NR ZONE-AMAX ZONE-OMAX ZONE-APP ZONE-WGRAN
147+
zloop0 host-managed 64M 32 0 0 1M 4K
148+
$ blkzone report /dev/zloop0
149+
start: 0x000000000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
150+
start: 0x000020000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
151+
start: 0x000040000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
152+
start: 0x000060000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
153+
start: 0x000080000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
154+
start: 0x0000a0000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
155+
start: 0x0000c0000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
156+
start: 0x0000e0000, len 0x020000, cap 0x020000, wptr 0x000000 reset:0 non-seq:0, zcond: 0(nw) [type: 1(CONVENTIONAL)]
157+
start: 0x000100000, len 0x020000, cap 0x01f800, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
158+
start: 0x000120000, len 0x020000, cap 0x01f800, wptr 0x000000 reset:0 non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
159+
...
160+
161+
Deleting this device is done using the command::
162+
163+
$ echo "remove id=0" > /dev/zloop-control
164+
165+
The removed device can be re-added again using the same "add" command as when
166+
the device was first created. To fully delete a zoned device, its backing files
167+
should also be deleted after executing the remove command::
168+
169+
$ rm -r /var/local/zloop/0

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26894,6 +26894,14 @@ L: [email protected]
2689426894
S: Maintained
2689526895
F: arch/x86/kernel/cpu/zhaoxin.c
2689626896

26897+
ZONED LOOP DEVICE
26898+
M: Damien Le Moal <[email protected]>
26899+
R: Christoph Hellwig <[email protected]>
26900+
26901+
S: Maintained
26902+
F: Documentation/admin-guide/blockdev/zoned_loop.rst
26903+
F: drivers/block/zloop.c
26904+
2689726905
ZONEFS FILESYSTEM
2689826906
M: Damien Le Moal <[email protected]>
2689926907
M: Naohiro Aota <[email protected]>

arch/mips/configs/gcw0_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CONFIG_MIPS_CMDLINE_DTB_EXTEND=y
1313
CONFIG_MODULES=y
1414
CONFIG_MODULE_UNLOAD=y
1515
# CONFIG_BLK_DEV_BSG is not set
16-
# CONFIG_BOUNCE is not set
1716
CONFIG_NET=y
1817
CONFIG_PACKET=y
1918
CONFIG_UNIX=y

block/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ config BLK_INLINE_ENCRYPTION_FALLBACK
211211

212212
source "block/partitions/Kconfig"
213213

214-
config BLK_MQ_PCI
215-
def_bool PCI
216-
217-
config BLK_MQ_VIRTIO
218-
bool
219-
depends on VIRTIO
220-
default y
221-
222214
config BLK_PM
223215
def_bool PM
224216

block/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55

66
obj-y := bdev.o fops.o bio.o elevator.o blk-core.o blk-sysfs.o \
77
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
8-
blk-merge.o blk-timeout.o \
9-
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
8+
blk-merge.o blk-timeout.o blk-lib.o blk-mq.o \
9+
blk-mq-tag.o blk-mq-dma.o blk-stat.o \
1010
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
1111
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o \
1212
disk-events.o blk-ia-ranges.o early-lookup.o
1313

14-
obj-$(CONFIG_BOUNCE) += bounce.o
1514
obj-$(CONFIG_BLK_DEV_BSG_COMMON) += bsg.o
1615
obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
1716
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o

block/bfq-iosched.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7210,8 +7210,8 @@ static void bfq_exit_queue(struct elevator_queue *e)
72107210
#endif
72117211

72127212
blk_stat_disable_accounting(bfqd->queue);
7213-
clear_bit(ELEVATOR_FLAG_DISABLE_WBT, &e->flags);
7214-
wbt_enable_default(bfqd->queue->disk);
7213+
blk_queue_flag_clear(QUEUE_FLAG_DISABLE_WBT_DEF, bfqd->queue);
7214+
set_bit(ELEVATOR_FLAG_ENABLE_WBT_ON_EXIT, &e->flags);
72157215

72167216
kfree(bfqd);
72177217
}
@@ -7397,7 +7397,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
73977397
/* We dispatch from request queue wide instead of hw queue */
73987398
blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
73997399

7400-
set_bit(ELEVATOR_FLAG_DISABLE_WBT, &eq->flags);
7400+
blk_queue_flag_set(QUEUE_FLAG_DISABLE_WBT_DEF, q);
74017401
wbt_disable_default(q->disk);
74027402
blk_stat_enable_accounting(q);
74037403

block/bio-integrity.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
127127

128128
if (bip->bip_vcnt > 0) {
129129
struct bio_vec *bv = &bip->bip_vec[bip->bip_vcnt - 1];
130-
bool same_page = false;
131130

132-
if (bvec_try_merge_hw_page(q, bv, page, len, offset,
133-
&same_page)) {
131+
if (bvec_try_merge_hw_page(q, bv, page, len, offset)) {
134132
bip->bip_iter.bi_size += len;
135133
return len;
136134
}

0 commit comments

Comments
 (0)