Skip to content

Commit f6e2d16

Browse files
committed
Merge: dm: sync with upstream v6.11
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5338 JIRA: https://issues.redhat.com/browse/RHEL-34750 JIRA: https://issues.redhat.com/browse/RHEL-59523 Tested: lvm2-testsuite (including the test for RHEL-34750), cryptsetup, and dmtest Upstream Status: kernel/git/torvalds/linux.git Pull in various dm changes from upstream. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Approved-by: Mikuláš Patočka <mpatocka@redhat.com> Approved-by: Heinz Mauelshagen <heinzm@redhat.com> Approved-by: Matthew Sakai <msakai@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents c40a13f + d252293 commit f6e2d16

Some content is hidden

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

57 files changed

+1315
-746
lines changed

Documentation/admin-guide/device-mapper/dm-crypt.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ same_cpu_crypt
113113
The default is to use an unbound workqueue so that encryption work
114114
is automatically balanced between available CPUs.
115115

116+
high_priority
117+
Set dm-crypt workqueues and the writer thread to high priority. This
118+
improves throughput and latency of dm-crypt while degrading general
119+
responsiveness of the system.
120+
116121
submit_from_crypt_cpus
117122
Disable offloading writes to a separate thread after encryption.
118123
There are some situations where offloading write bios from the
@@ -157,13 +162,14 @@ iv_large_sectors
157162

158163

159164
Module parameters::
160-
max_read_size
161-
max_write_size
162-
Maximum size of read or write requests. When a request larger than this size
163-
is received, dm-crypt will split the request. The splitting improves
164-
concurrency (the split requests could be encrypted in parallel by multiple
165-
cores), but it also causes overhead. The user should tune these parameters to
166-
fit the actual workload.
165+
166+
max_read_size
167+
max_write_size
168+
Maximum size of read or write requests. When a request larger than this size
169+
is received, dm-crypt will split the request. The splitting improves
170+
concurrency (the split requests could be encrypted in parallel by multiple
171+
cores), but it also causes overhead. The user should tune these parameters to
172+
fit the actual workload.
167173

168174

169175
Example scripts

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5573,7 +5573,6 @@ DEVICE-MAPPER (LVM)
55735573
M: Alasdair Kergon <agk@redhat.com>
55745574
M: Mike Snitzer <snitzer@kernel.org>
55755575
M: Mikulas Patocka <mpatocka@redhat.com>
5576-
M: dm-devel@lists.linux.dev
55775576
L: dm-devel@lists.linux.dev
55785577
S: Maintained
55795578
Q: http://patchwork.kernel.org/project/dm-devel/list/

drivers/md/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,16 @@ config DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
571571

572572
If unsure, say N.
573573

574+
config DM_VERITY_VERIFY_ROOTHASH_SIG_PLATFORM_KEYRING
575+
bool "Verity data device root hash signature verification with platform keyring"
576+
default DM_VERITY_VERIFY_ROOTHASH_SIG_SECONDARY_KEYRING
577+
depends on DM_VERITY_VERIFY_ROOTHASH_SIG
578+
depends on INTEGRITY_PLATFORM_KEYRING
579+
help
580+
Rely also on the platform keyring to verify dm-verity signatures.
581+
582+
If unsure, say N.
583+
574584
config DM_VERITY_FEC
575585
bool "Verity forward error correction support"
576586
depends on DM_VERITY

drivers/md/dm-bio-prison-v1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,5 +489,5 @@ module_init(dm_bio_prison_init);
489489
module_exit(dm_bio_prison_exit);
490490

491491
MODULE_DESCRIPTION(DM_NAME " bio prison");
492-
MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>");
492+
MODULE_AUTHOR("Joe Thornber <dm-devel@lists.linux.dev>");
493493
MODULE_LICENSE("GPL");

drivers/md/dm-bufio.c

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,8 @@ static void dmio_complete(unsigned long error, void *context)
12921292
}
12931293

12941294
static void use_dmio(struct dm_buffer *b, enum req_op op, sector_t sector,
1295-
unsigned int n_sectors, unsigned int offset)
1295+
unsigned int n_sectors, unsigned int offset,
1296+
unsigned short ioprio)
12961297
{
12971298
int r;
12981299
struct dm_io_request io_req = {
@@ -1315,7 +1316,7 @@ static void use_dmio(struct dm_buffer *b, enum req_op op, sector_t sector,
13151316
io_req.mem.ptr.vma = (char *)b->data + offset;
13161317
}
13171318

1318-
r = dm_io(&io_req, 1, &region, NULL);
1319+
r = dm_io(&io_req, 1, &region, NULL, ioprio);
13191320
if (unlikely(r))
13201321
b->end_io(b, errno_to_blk_status(r));
13211322
}
@@ -1331,21 +1332,23 @@ static void bio_complete(struct bio *bio)
13311332
}
13321333

13331334
static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
1334-
unsigned int n_sectors, unsigned int offset)
1335+
unsigned int n_sectors, unsigned int offset,
1336+
unsigned short ioprio)
13351337
{
13361338
struct bio *bio;
13371339
char *ptr;
13381340
unsigned int len;
13391341

13401342
bio = bio_kmalloc(1, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOWARN);
13411343
if (!bio) {
1342-
use_dmio(b, op, sector, n_sectors, offset);
1344+
use_dmio(b, op, sector, n_sectors, offset, ioprio);
13431345
return;
13441346
}
13451347
bio_init(bio, b->c->bdev, bio->bi_inline_vecs, 1, op);
13461348
bio->bi_iter.bi_sector = sector;
13471349
bio->bi_end_io = bio_complete;
13481350
bio->bi_private = b;
1351+
bio->bi_ioprio = ioprio;
13491352

13501353
ptr = (char *)b->data + offset;
13511354
len = n_sectors << SECTOR_SHIFT;
@@ -1368,7 +1371,7 @@ static inline sector_t block_to_sector(struct dm_bufio_client *c, sector_t block
13681371
return sector;
13691372
}
13701373

1371-
static void submit_io(struct dm_buffer *b, enum req_op op,
1374+
static void submit_io(struct dm_buffer *b, enum req_op op, unsigned short ioprio,
13721375
void (*end_io)(struct dm_buffer *, blk_status_t))
13731376
{
13741377
unsigned int n_sectors;
@@ -1398,9 +1401,9 @@ static void submit_io(struct dm_buffer *b, enum req_op op,
13981401
}
13991402

14001403
if (b->data_mode != DATA_MODE_VMALLOC)
1401-
use_bio(b, op, sector, n_sectors, offset);
1404+
use_bio(b, op, sector, n_sectors, offset, ioprio);
14021405
else
1403-
use_dmio(b, op, sector, n_sectors, offset);
1406+
use_dmio(b, op, sector, n_sectors, offset, ioprio);
14041407
}
14051408

14061409
/*
@@ -1456,7 +1459,7 @@ static void __write_dirty_buffer(struct dm_buffer *b,
14561459
b->write_end = b->dirty_end;
14571460

14581461
if (!write_list)
1459-
submit_io(b, REQ_OP_WRITE, write_endio);
1462+
submit_io(b, REQ_OP_WRITE, IOPRIO_DEFAULT, write_endio);
14601463
else
14611464
list_add_tail(&b->write_list, write_list);
14621465
}
@@ -1470,7 +1473,7 @@ static void __flush_write_list(struct list_head *write_list)
14701473
struct dm_buffer *b =
14711474
list_entry(write_list->next, struct dm_buffer, write_list);
14721475
list_del(&b->write_list);
1473-
submit_io(b, REQ_OP_WRITE, write_endio);
1476+
submit_io(b, REQ_OP_WRITE, IOPRIO_DEFAULT, write_endio);
14741477
cond_resched();
14751478
}
14761479
blk_finish_plug(&plug);
@@ -1852,7 +1855,8 @@ static void read_endio(struct dm_buffer *b, blk_status_t status)
18521855
* and uses dm_bufio_mark_buffer_dirty to write new data back).
18531856
*/
18541857
static void *new_read(struct dm_bufio_client *c, sector_t block,
1855-
enum new_flag nf, struct dm_buffer **bp)
1858+
enum new_flag nf, struct dm_buffer **bp,
1859+
unsigned short ioprio)
18561860
{
18571861
int need_submit = 0;
18581862
struct dm_buffer *b;
@@ -1905,7 +1909,7 @@ static void *new_read(struct dm_bufio_client *c, sector_t block,
19051909
return NULL;
19061910

19071911
if (need_submit)
1908-
submit_io(b, REQ_OP_READ, read_endio);
1912+
submit_io(b, REQ_OP_READ, ioprio, read_endio);
19091913

19101914
if (nf != NF_GET) /* we already tested this condition above */
19111915
wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE);
@@ -1926,32 +1930,46 @@ static void *new_read(struct dm_bufio_client *c, sector_t block,
19261930
void *dm_bufio_get(struct dm_bufio_client *c, sector_t block,
19271931
struct dm_buffer **bp)
19281932
{
1929-
return new_read(c, block, NF_GET, bp);
1933+
return new_read(c, block, NF_GET, bp, IOPRIO_DEFAULT);
19301934
}
19311935
EXPORT_SYMBOL_GPL(dm_bufio_get);
19321936

1933-
void *dm_bufio_read(struct dm_bufio_client *c, sector_t block,
1934-
struct dm_buffer **bp)
1937+
static void *__dm_bufio_read(struct dm_bufio_client *c, sector_t block,
1938+
struct dm_buffer **bp, unsigned short ioprio)
19351939
{
19361940
if (WARN_ON_ONCE(dm_bufio_in_request()))
19371941
return ERR_PTR(-EINVAL);
19381942

1939-
return new_read(c, block, NF_READ, bp);
1943+
return new_read(c, block, NF_READ, bp, ioprio);
1944+
}
1945+
1946+
void *dm_bufio_read(struct dm_bufio_client *c, sector_t block,
1947+
struct dm_buffer **bp)
1948+
{
1949+
return __dm_bufio_read(c, block, bp, IOPRIO_DEFAULT);
19401950
}
19411951
EXPORT_SYMBOL_GPL(dm_bufio_read);
19421952

1953+
void *dm_bufio_read_with_ioprio(struct dm_bufio_client *c, sector_t block,
1954+
struct dm_buffer **bp, unsigned short ioprio)
1955+
{
1956+
return __dm_bufio_read(c, block, bp, ioprio);
1957+
}
1958+
EXPORT_SYMBOL_GPL(dm_bufio_read_with_ioprio);
1959+
19431960
void *dm_bufio_new(struct dm_bufio_client *c, sector_t block,
19441961
struct dm_buffer **bp)
19451962
{
19461963
if (WARN_ON_ONCE(dm_bufio_in_request()))
19471964
return ERR_PTR(-EINVAL);
19481965

1949-
return new_read(c, block, NF_FRESH, bp);
1966+
return new_read(c, block, NF_FRESH, bp, IOPRIO_DEFAULT);
19501967
}
19511968
EXPORT_SYMBOL_GPL(dm_bufio_new);
19521969

1953-
void dm_bufio_prefetch(struct dm_bufio_client *c,
1954-
sector_t block, unsigned int n_blocks)
1970+
static void __dm_bufio_prefetch(struct dm_bufio_client *c,
1971+
sector_t block, unsigned int n_blocks,
1972+
unsigned short ioprio)
19551973
{
19561974
struct blk_plug plug;
19571975

@@ -1987,7 +2005,7 @@ void dm_bufio_prefetch(struct dm_bufio_client *c,
19872005
dm_bufio_unlock(c);
19882006

19892007
if (need_submit)
1990-
submit_io(b, REQ_OP_READ, read_endio);
2008+
submit_io(b, REQ_OP_READ, ioprio, read_endio);
19912009
dm_bufio_release(b);
19922010

19932011
cond_resched();
@@ -2002,8 +2020,20 @@ void dm_bufio_prefetch(struct dm_bufio_client *c,
20022020
flush_plug:
20032021
blk_finish_plug(&plug);
20042022
}
2023+
2024+
void dm_bufio_prefetch(struct dm_bufio_client *c, sector_t block, unsigned int n_blocks)
2025+
{
2026+
return __dm_bufio_prefetch(c, block, n_blocks, IOPRIO_DEFAULT);
2027+
}
20052028
EXPORT_SYMBOL_GPL(dm_bufio_prefetch);
20062029

2030+
void dm_bufio_prefetch_with_ioprio(struct dm_bufio_client *c, sector_t block,
2031+
unsigned int n_blocks, unsigned short ioprio)
2032+
{
2033+
return __dm_bufio_prefetch(c, block, n_blocks, ioprio);
2034+
}
2035+
EXPORT_SYMBOL_GPL(dm_bufio_prefetch_with_ioprio);
2036+
20072037
void dm_bufio_release(struct dm_buffer *b)
20082038
{
20092039
struct dm_bufio_client *c = b->c;
@@ -2167,7 +2197,7 @@ int dm_bufio_issue_flush(struct dm_bufio_client *c)
21672197
if (WARN_ON_ONCE(dm_bufio_in_request()))
21682198
return -EINVAL;
21692199

2170-
return dm_io(&io_req, 1, &io_reg, NULL);
2200+
return dm_io(&io_req, 1, &io_reg, NULL, IOPRIO_DEFAULT);
21712201
}
21722202
EXPORT_SYMBOL_GPL(dm_bufio_issue_flush);
21732203

@@ -2191,7 +2221,7 @@ int dm_bufio_issue_discard(struct dm_bufio_client *c, sector_t block, sector_t c
21912221
if (WARN_ON_ONCE(dm_bufio_in_request()))
21922222
return -EINVAL; /* discards are optional */
21932223

2194-
return dm_io(&io_req, 1, &io_reg, NULL);
2224+
return dm_io(&io_req, 1, &io_reg, NULL, IOPRIO_DEFAULT);
21952225
}
21962226
EXPORT_SYMBOL_GPL(dm_bufio_issue_discard);
21972227

@@ -2962,6 +2992,6 @@ MODULE_PARM_DESC(allocated_vmalloc_bytes, "Memory allocated with vmalloc");
29622992
module_param_named(current_allocated_bytes, dm_bufio_current_allocated, ulong, 0444);
29632993
MODULE_PARM_DESC(current_allocated_bytes, "Memory currently used by the cache");
29642994

2965-
MODULE_AUTHOR("Mikulas Patocka <dm-devel@redhat.com>");
2995+
MODULE_AUTHOR("Mikulas Patocka <dm-devel@lists.linux.dev>");
29662996
MODULE_DESCRIPTION(DM_NAME " buffered I/O library");
29672997
MODULE_LICENSE("GPL");

drivers/md/dm-cache-metadata.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ struct dm_cache_metadata {
170170
*/
171171
#define SUPERBLOCK_CSUM_XOR 9031977
172172

173-
static void sb_prepare_for_write(struct dm_block_validator *v,
173+
static void sb_prepare_for_write(const struct dm_block_validator *v,
174174
struct dm_block *b,
175175
size_t sb_block_size)
176176
{
@@ -195,7 +195,7 @@ static int check_metadata_version(struct cache_disk_superblock *disk_super)
195195
return 0;
196196
}
197197

198-
static int sb_check(struct dm_block_validator *v,
198+
static int sb_check(const struct dm_block_validator *v,
199199
struct dm_block *b,
200200
size_t sb_block_size)
201201
{
@@ -228,7 +228,7 @@ static int sb_check(struct dm_block_validator *v,
228228
return check_metadata_version(disk_super);
229229
}
230230

231-
static struct dm_block_validator sb_validator = {
231+
static const struct dm_block_validator sb_validator = {
232232
.name = "superblock",
233233
.prepare_for_write = sb_prepare_for_write,
234234
.check = sb_check
@@ -1282,15 +1282,6 @@ int dm_cache_insert_mapping(struct dm_cache_metadata *cmd,
12821282
return r;
12831283
}
12841284

1285-
struct thunk {
1286-
load_mapping_fn fn;
1287-
void *context;
1288-
1289-
struct dm_cache_metadata *cmd;
1290-
bool respect_dirty_flags;
1291-
bool hints_valid;
1292-
};
1293-
12941285
static bool policy_unchanged(struct dm_cache_metadata *cmd,
12951286
struct dm_cache_policy *policy)
12961287
{

drivers/md/dm-cache-policy-smq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ static void __exit smq_exit(void)
19471947
module_init(smq_init);
19481948
module_exit(smq_exit);
19491949

1950-
MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>");
1950+
MODULE_AUTHOR("Joe Thornber <dm-devel@lists.linux.dev>");
19511951
MODULE_LICENSE("GPL");
19521952
MODULE_DESCRIPTION("smq cache policy");
19531953

drivers/md/dm-cache-target.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,8 +3416,8 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits)
34163416
*/
34173417
if (io_opt_sectors < cache->sectors_per_block ||
34183418
do_div(io_opt_sectors, cache->sectors_per_block)) {
3419-
blk_limits_io_min(limits, cache->sectors_per_block << SECTOR_SHIFT);
3420-
blk_limits_io_opt(limits, cache->sectors_per_block << SECTOR_SHIFT);
3419+
limits->io_min = cache->sectors_per_block << SECTOR_SHIFT;
3420+
limits->io_opt = cache->sectors_per_block << SECTOR_SHIFT;
34213421
}
34223422

34233423
disable_passdown_if_not_supported(cache);

drivers/md/dm-clone-metadata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct dm_clone_metadata {
163163
/*
164164
* Superblock validation.
165165
*/
166-
static void sb_prepare_for_write(struct dm_block_validator *v,
166+
static void sb_prepare_for_write(const struct dm_block_validator *v,
167167
struct dm_block *b, size_t sb_block_size)
168168
{
169169
struct superblock_disk *sb;
@@ -177,7 +177,7 @@ static void sb_prepare_for_write(struct dm_block_validator *v,
177177
sb->csum = cpu_to_le32(csum);
178178
}
179179

180-
static int sb_check(struct dm_block_validator *v, struct dm_block *b,
180+
static int sb_check(const struct dm_block_validator *v, struct dm_block *b,
181181
size_t sb_block_size)
182182
{
183183
struct superblock_disk *sb;
@@ -220,7 +220,7 @@ static int sb_check(struct dm_block_validator *v, struct dm_block *b,
220220
return 0;
221221
}
222222

223-
static struct dm_block_validator sb_validator = {
223+
static const struct dm_block_validator sb_validator = {
224224
.name = "superblock",
225225
.prepare_for_write = sb_prepare_for_write,
226226
.check = sb_check

drivers/md/dm-clone-target.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,8 +2073,8 @@ static void clone_io_hints(struct dm_target *ti, struct queue_limits *limits)
20732073
*/
20742074
if (io_opt_sectors < clone->region_size ||
20752075
do_div(io_opt_sectors, clone->region_size)) {
2076-
blk_limits_io_min(limits, clone->region_size << SECTOR_SHIFT);
2077-
blk_limits_io_opt(limits, clone->region_size << SECTOR_SHIFT);
2076+
limits->io_min = clone->region_size << SECTOR_SHIFT;
2077+
limits->io_opt = clone->region_size << SECTOR_SHIFT;
20782078
}
20792079

20802080
disable_passdown_if_not_supported(clone);

0 commit comments

Comments
 (0)