Commit 5d132438 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231226090747.204969-1-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1c042f8d
...@@ -837,8 +837,6 @@ void blk_queue_write_cache(struct request_queue *q, bool wc, bool fua) ...@@ -837,8 +837,6 @@ void blk_queue_write_cache(struct request_queue *q, bool wc, bool fua)
blk_queue_flag_set(QUEUE_FLAG_FUA, q); blk_queue_flag_set(QUEUE_FLAG_FUA, q);
else else
blk_queue_flag_clear(QUEUE_FLAG_FUA, q); blk_queue_flag_clear(QUEUE_FLAG_FUA, q);
wbt_set_write_cache(q, test_bit(QUEUE_FLAG_WC, &q->queue_flags));
} }
EXPORT_SYMBOL_GPL(blk_queue_write_cache); EXPORT_SYMBOL_GPL(blk_queue_write_cache);
......
...@@ -84,8 +84,6 @@ struct rq_wb { ...@@ -84,8 +84,6 @@ struct rq_wb {
u64 sync_issue; u64 sync_issue;
void *sync_cookie; void *sync_cookie;
unsigned int wc;
unsigned long last_issue; /* last non-throttled issue */ unsigned long last_issue; /* last non-throttled issue */
unsigned long last_comp; /* last non-throttled comp */ unsigned long last_comp; /* last non-throttled comp */
unsigned long min_lat_nsec; unsigned long min_lat_nsec;
...@@ -207,7 +205,8 @@ static void wbt_rqw_done(struct rq_wb *rwb, struct rq_wait *rqw, ...@@ -207,7 +205,8 @@ static void wbt_rqw_done(struct rq_wb *rwb, struct rq_wait *rqw,
*/ */
if (wb_acct & WBT_DISCARD) if (wb_acct & WBT_DISCARD)
limit = rwb->wb_background; limit = rwb->wb_background;
else if (rwb->wc && !wb_recent_wait(rwb)) else if (test_bit(QUEUE_FLAG_WC, &rwb->rqos.disk->queue->queue_flags) &&
!wb_recent_wait(rwb))
limit = 0; limit = 0;
else else
limit = rwb->wb_normal; limit = rwb->wb_normal;
...@@ -699,13 +698,6 @@ static void wbt_requeue(struct rq_qos *rqos, struct request *rq) ...@@ -699,13 +698,6 @@ static void wbt_requeue(struct rq_qos *rqos, struct request *rq)
} }
} }
void wbt_set_write_cache(struct request_queue *q, bool write_cache_on)
{
struct rq_qos *rqos = wbt_rq_qos(q);
if (rqos)
RQWB(rqos)->wc = write_cache_on;
}
/* /*
* Enable wbt if defaults are configured that way * Enable wbt if defaults are configured that way
*/ */
...@@ -918,7 +910,6 @@ int wbt_init(struct gendisk *disk) ...@@ -918,7 +910,6 @@ int wbt_init(struct gendisk *disk)
rwb->last_comp = rwb->last_issue = jiffies; rwb->last_comp = rwb->last_issue = jiffies;
rwb->win_nsec = RWB_WINDOW_NSEC; rwb->win_nsec = RWB_WINDOW_NSEC;
rwb->enable_state = WBT_STATE_ON_DEFAULT; rwb->enable_state = WBT_STATE_ON_DEFAULT;
rwb->wc = test_bit(QUEUE_FLAG_WC, &q->queue_flags);
rwb->rq_depth.default_depth = RWB_DEF_DEPTH; rwb->rq_depth.default_depth = RWB_DEF_DEPTH;
rwb->min_lat_nsec = wbt_default_latency_nsec(q); rwb->min_lat_nsec = wbt_default_latency_nsec(q);
rwb->rq_depth.queue_depth = blk_queue_depth(q); rwb->rq_depth.queue_depth = blk_queue_depth(q);
......
...@@ -12,8 +12,6 @@ u64 wbt_get_min_lat(struct request_queue *q); ...@@ -12,8 +12,6 @@ u64 wbt_get_min_lat(struct request_queue *q);
void wbt_set_min_lat(struct request_queue *q, u64 val); void wbt_set_min_lat(struct request_queue *q, u64 val);
bool wbt_disabled(struct request_queue *); bool wbt_disabled(struct request_queue *);
void wbt_set_write_cache(struct request_queue *, bool);
u64 wbt_default_latency_nsec(struct request_queue *); u64 wbt_default_latency_nsec(struct request_queue *);
#else #else
...@@ -24,9 +22,6 @@ static inline void wbt_disable_default(struct gendisk *disk) ...@@ -24,9 +22,6 @@ static inline void wbt_disable_default(struct gendisk *disk)
static inline void wbt_enable_default(struct gendisk *disk) static inline void wbt_enable_default(struct gendisk *disk)
{ {
} }
static inline void wbt_set_write_cache(struct request_queue *q, bool wc)
{
}
#endif /* CONFIG_BLK_WBT */ #endif /* CONFIG_BLK_WBT */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment