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.

block: Replace zone_wlock debugfs entry with zone_wplugs entry

In preparation to completely remove zone write locking, replace the
"zone_wlock" mq-debugfs entry that was listing zones that are
write-locked with the zone_wplugs entry which lists the zones that
currently have a write plug allocated.

The write plug information provided is: the zone number, the zone write
plug flags, the zone write plug write pointer offset and the number of
BIOs currently waiting for execution in the zone write plug BIO list.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hans Holmberg <hans.holmberg@wdc.com>
Tested-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240408014128.205141-26-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Damien Le Moal and committed by
Jens Axboe
a98b05b0 d9f1439a

+27 -10
+1 -1
block/blk-mq-debugfs.c
··· 160 160 { "requeue_list", 0400, .seq_ops = &queue_requeue_list_seq_ops }, 161 161 { "pm_only", 0600, queue_pm_only_show, NULL }, 162 162 { "state", 0600, queue_state_show, queue_state_write }, 163 - { "zone_wlock", 0400, queue_zone_wlock_show, NULL }, 163 + { "zone_wplugs", 0400, queue_zone_wplugs_show, NULL }, 164 164 { }, 165 165 }; 166 166
+2 -2
block/blk-mq-debugfs.h
··· 84 84 #endif 85 85 86 86 #if defined(CONFIG_BLK_DEV_ZONED) && defined(CONFIG_BLK_DEBUG_FS) 87 - int queue_zone_wlock_show(void *data, struct seq_file *m); 87 + int queue_zone_wplugs_show(void *data, struct seq_file *m); 88 88 #else 89 - static inline int queue_zone_wlock_show(void *data, struct seq_file *m) 89 + static inline int queue_zone_wplugs_show(void *data, struct seq_file *m) 90 90 { 91 91 return 0; 92 92 }
+24 -7
block/blk-zoned.c
··· 1808 1808 1809 1809 #ifdef CONFIG_BLK_DEBUG_FS 1810 1810 1811 - int queue_zone_wlock_show(void *data, struct seq_file *m) 1811 + int queue_zone_wplugs_show(void *data, struct seq_file *m) 1812 1812 { 1813 1813 struct request_queue *q = data; 1814 - unsigned int i; 1814 + struct gendisk *disk = q->disk; 1815 + struct blk_zone_wplug *zwplug; 1816 + unsigned int zwp_wp_offset, zwp_flags; 1817 + unsigned int zwp_zone_no, zwp_ref; 1818 + unsigned int zwp_bio_list_size, i; 1819 + unsigned long flags; 1815 1820 1816 - if (!q->disk->seq_zones_wlock) 1817 - return 0; 1821 + rcu_read_lock(); 1822 + for (i = 0; i < disk_zone_wplugs_hash_size(disk); i++) { 1823 + hlist_for_each_entry_rcu(zwplug, 1824 + &disk->zone_wplugs_hash[i], node) { 1825 + spin_lock_irqsave(&zwplug->lock, flags); 1826 + zwp_zone_no = zwplug->zone_no; 1827 + zwp_flags = zwplug->flags; 1828 + zwp_ref = atomic_read(&zwplug->ref); 1829 + zwp_wp_offset = zwplug->wp_offset; 1830 + zwp_bio_list_size = bio_list_size(&zwplug->bio_list); 1831 + spin_unlock_irqrestore(&zwplug->lock, flags); 1818 1832 1819 - for (i = 0; i < q->disk->nr_zones; i++) 1820 - if (test_bit(i, q->disk->seq_zones_wlock)) 1821 - seq_printf(m, "%u\n", i); 1833 + seq_printf(m, "%u 0x%x %u %u %u\n", 1834 + zwp_zone_no, zwp_flags, zwp_ref, 1835 + zwp_wp_offset, zwp_bio_list_size); 1836 + } 1837 + } 1838 + rcu_read_unlock(); 1822 1839 1823 1840 return 0; 1824 1841 }