Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'block-5.17-2022-01-28' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- NVMe pull request
- add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs (Wu
Zheng)
- remove the unneeded ret variable in nvmf_dev_show (Changcheng
Deng)

- Fix for a hang regression introduced with a patch in the merge
window, where low queue depth devices would not always get woken
correctly (Laibin)

- Small series fixing an IO accounting issue with bio backed dm devices
(Mike, Yu)

* tag 'block-5.17-2022-01-28' of git://git.kernel.dk/linux-block:
dm: properly fix redundant bio-based IO accounting
dm: revert partial fix for redundant bio-based IO accounting
block: add bio_start_io_acct_time() to control start_time
blk-mq: Fix wrong wakeup batch configuration which will cause hang
nvme-fabrics: remove the unneeded ret variable in nvmf_dev_show
nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs
blk-mq: fix missing blk_account_io_done() in error path
block: fix memory leak in disk_register_independent_access_ranges

+35 -29
+19 -6
block/blk-core.c
··· 1061 1061 } 1062 1062 1063 1063 static unsigned long __part_start_io_acct(struct block_device *part, 1064 - unsigned int sectors, unsigned int op) 1064 + unsigned int sectors, unsigned int op, 1065 + unsigned long start_time) 1065 1066 { 1066 1067 const int sgrp = op_stat_group(op); 1067 - unsigned long now = READ_ONCE(jiffies); 1068 1068 1069 1069 part_stat_lock(); 1070 - update_io_ticks(part, now, false); 1070 + update_io_ticks(part, start_time, false); 1071 1071 part_stat_inc(part, ios[sgrp]); 1072 1072 part_stat_add(part, sectors[sgrp], sectors); 1073 1073 part_stat_local_inc(part, in_flight[op_is_write(op)]); 1074 1074 part_stat_unlock(); 1075 1075 1076 - return now; 1076 + return start_time; 1077 1077 } 1078 + 1079 + /** 1080 + * bio_start_io_acct_time - start I/O accounting for bio based drivers 1081 + * @bio: bio to start account for 1082 + * @start_time: start time that should be passed back to bio_end_io_acct(). 1083 + */ 1084 + void bio_start_io_acct_time(struct bio *bio, unsigned long start_time) 1085 + { 1086 + __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), 1087 + bio_op(bio), start_time); 1088 + } 1089 + EXPORT_SYMBOL_GPL(bio_start_io_acct_time); 1078 1090 1079 1091 /** 1080 1092 * bio_start_io_acct - start I/O accounting for bio based drivers ··· 1096 1084 */ 1097 1085 unsigned long bio_start_io_acct(struct bio *bio) 1098 1086 { 1099 - return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), bio_op(bio)); 1087 + return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), 1088 + bio_op(bio), jiffies); 1100 1089 } 1101 1090 EXPORT_SYMBOL_GPL(bio_start_io_acct); 1102 1091 1103 1092 unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors, 1104 1093 unsigned int op) 1105 1094 { 1106 - return __part_start_io_acct(disk->part0, sectors, op); 1095 + return __part_start_io_acct(disk->part0, sectors, op, jiffies); 1107 1096 } 1108 1097 EXPORT_SYMBOL(disk_start_io_acct); 1109 1098
+1 -1
block/blk-ia-ranges.c
··· 144 144 &q->kobj, "%s", "independent_access_ranges"); 145 145 if (ret) { 146 146 q->ia_ranges = NULL; 147 - kfree(iars); 147 + kobject_put(&iars->kobj); 148 148 return ret; 149 149 } 150 150
+2
block/blk-mq.c
··· 2922 2922 */ 2923 2923 blk_mq_run_dispatch_ops(rq->q, 2924 2924 ret = blk_mq_request_issue_directly(rq, true)); 2925 + if (ret) 2926 + blk_account_io_done(rq, ktime_get_ns()); 2925 2927 return ret; 2926 2928 } 2927 2929 EXPORT_SYMBOL_GPL(blk_insert_cloned_request);
+3 -17
drivers/md/dm.c
··· 489 489 struct mapped_device *md = io->md; 490 490 struct bio *bio = io->orig_bio; 491 491 492 - io->start_time = bio_start_io_acct(bio); 492 + bio_start_io_acct_time(bio, io->start_time); 493 493 if (unlikely(dm_stats_used(&md->stats))) 494 494 dm_stats_account_io(&md->stats, bio_data_dir(bio), 495 495 bio->bi_iter.bi_sector, bio_sectors(bio), ··· 535 535 io->md = md; 536 536 spin_lock_init(&io->endio_lock); 537 537 538 - start_io_acct(io); 538 + io->start_time = jiffies; 539 539 540 540 return io; 541 541 } ··· 1442 1442 ci->sector = bio->bi_iter.bi_sector; 1443 1443 } 1444 1444 1445 - #define __dm_part_stat_sub(part, field, subnd) \ 1446 - (part_stat_get(part, field) -= (subnd)) 1447 - 1448 1445 /* 1449 1446 * Entry point to split a bio into clones and submit them to the targets. 1450 1447 */ ··· 1477 1480 GFP_NOIO, &md->queue->bio_split); 1478 1481 ci.io->orig_bio = b; 1479 1482 1480 - /* 1481 - * Adjust IO stats for each split, otherwise upon queue 1482 - * reentry there will be redundant IO accounting. 1483 - * NOTE: this is a stop-gap fix, a proper fix involves 1484 - * significant refactoring of DM core's bio splitting 1485 - * (by eliminating DM's splitting and just using bio_split) 1486 - */ 1487 - part_stat_lock(); 1488 - __dm_part_stat_sub(dm_disk(md)->part0, 1489 - sectors[op_stat_group(bio_op(bio))], ci.sector_count); 1490 - part_stat_unlock(); 1491 - 1492 1483 bio_chain(b, bio); 1493 1484 trace_block_split(b, bio->bi_iter.bi_sector); 1494 1485 submit_bio_noacct(bio); 1495 1486 } 1496 1487 } 1488 + start_io_acct(ci.io); 1497 1489 1498 1490 /* drop the extra reference count */ 1499 1491 dm_io_dec_pending(ci.io, errno_to_blk_status(error));
+1 -2
drivers/nvme/host/fabrics.c
··· 1092 1092 static int nvmf_dev_show(struct seq_file *seq_file, void *private) 1093 1093 { 1094 1094 struct nvme_ctrl *ctrl; 1095 - int ret = 0; 1096 1095 1097 1096 mutex_lock(&nvmf_dev_mutex); 1098 1097 ctrl = seq_file->private; ··· 1105 1106 1106 1107 out_unlock: 1107 1108 mutex_unlock(&nvmf_dev_mutex); 1108 - return ret; 1109 + return 0; 1109 1110 } 1110 1111 1111 1112 static int nvmf_dev_open(struct inode *inode, struct file *file)
+2 -1
drivers/nvme/host/pci.c
··· 3391 3391 NVME_QUIRK_DEALLOCATE_ZEROES, }, 3392 3392 { PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */ 3393 3393 .driver_data = NVME_QUIRK_STRIPE_SIZE | 3394 - NVME_QUIRK_DEALLOCATE_ZEROES, }, 3394 + NVME_QUIRK_DEALLOCATE_ZEROES | 3395 + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3395 3396 { PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */ 3396 3397 .driver_data = NVME_QUIRK_STRIPE_SIZE | 3397 3398 NVME_QUIRK_DEALLOCATE_ZEROES, },
+1
include/linux/blkdev.h
··· 1258 1258 void disk_end_io_acct(struct gendisk *disk, unsigned int op, 1259 1259 unsigned long start_time); 1260 1260 1261 + void bio_start_io_acct_time(struct bio *bio, unsigned long start_time); 1261 1262 unsigned long bio_start_io_acct(struct bio *bio); 1262 1263 void bio_end_io_acct_remapped(struct bio *bio, unsigned long start_time, 1263 1264 struct block_device *orig_bdev);
+6 -2
lib/sbitmap.c
··· 488 488 unsigned int users) 489 489 { 490 490 unsigned int wake_batch; 491 + unsigned int min_batch; 492 + unsigned int depth = (sbq->sb.depth + users - 1) / users; 491 493 492 - wake_batch = clamp_val((sbq->sb.depth + users - 1) / 493 - users, 4, SBQ_WAKE_BATCH); 494 + min_batch = sbq->sb.depth >= (4 * SBQ_WAIT_QUEUES) ? 4 : 1; 495 + 496 + wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES, 497 + min_batch, SBQ_WAKE_BATCH); 494 498 __sbitmap_queue_update_wake_batch(sbq, wake_batch); 495 499 } 496 500 EXPORT_SYMBOL_GPL(sbitmap_queue_recalculate_wake_batch);