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.

blk-wbt: remove the separate write cache tracking

Use the queue wide write back cache tracking insted of duplicating the
value in strut rq_wb.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231226090747.204969-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
5d132438 1c042f8d

+2 -18
-2
block/blk-settings.c
··· 837 837 blk_queue_flag_set(QUEUE_FLAG_FUA, q); 838 838 else 839 839 blk_queue_flag_clear(QUEUE_FLAG_FUA, q); 840 - 841 - wbt_set_write_cache(q, test_bit(QUEUE_FLAG_WC, &q->queue_flags)); 842 840 } 843 841 EXPORT_SYMBOL_GPL(blk_queue_write_cache); 844 842
+2 -11
block/blk-wbt.c
··· 84 84 u64 sync_issue; 85 85 void *sync_cookie; 86 86 87 - unsigned int wc; 88 - 89 87 unsigned long last_issue; /* last non-throttled issue */ 90 88 unsigned long last_comp; /* last non-throttled comp */ 91 89 unsigned long min_lat_nsec; ··· 205 207 */ 206 208 if (wb_acct & WBT_DISCARD) 207 209 limit = rwb->wb_background; 208 - else if (rwb->wc && !wb_recent_wait(rwb)) 210 + else if (test_bit(QUEUE_FLAG_WC, &rwb->rqos.disk->queue->queue_flags) && 211 + !wb_recent_wait(rwb)) 209 212 limit = 0; 210 213 else 211 214 limit = rwb->wb_normal; ··· 698 699 } 699 700 } 700 701 701 - void wbt_set_write_cache(struct request_queue *q, bool write_cache_on) 702 - { 703 - struct rq_qos *rqos = wbt_rq_qos(q); 704 - if (rqos) 705 - RQWB(rqos)->wc = write_cache_on; 706 - } 707 - 708 702 /* 709 703 * Enable wbt if defaults are configured that way 710 704 */ ··· 910 918 rwb->last_comp = rwb->last_issue = jiffies; 911 919 rwb->win_nsec = RWB_WINDOW_NSEC; 912 920 rwb->enable_state = WBT_STATE_ON_DEFAULT; 913 - rwb->wc = test_bit(QUEUE_FLAG_WC, &q->queue_flags); 914 921 rwb->rq_depth.default_depth = RWB_DEF_DEPTH; 915 922 rwb->min_lat_nsec = wbt_default_latency_nsec(q); 916 923 rwb->rq_depth.queue_depth = blk_queue_depth(q);
-5
block/blk-wbt.h
··· 12 12 void wbt_set_min_lat(struct request_queue *q, u64 val); 13 13 bool wbt_disabled(struct request_queue *); 14 14 15 - void wbt_set_write_cache(struct request_queue *, bool); 16 - 17 15 u64 wbt_default_latency_nsec(struct request_queue *); 18 16 19 17 #else ··· 20 22 { 21 23 } 22 24 static inline void wbt_enable_default(struct gendisk *disk) 23 - { 24 - } 25 - static inline void wbt_set_write_cache(struct request_queue *q, bool wc) 26 25 { 27 26 } 28 27