cleanup for blk-wbt
cover cleanup for blk-wbt
Hi Jens,
several cleanup for blk-wbt, no function change, thanks
weiping zhang (5):
blk-wbt: remove duplicated setting in wbt_init
blk-wbt: cleanup comments to one line
blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
blk-wbt: move wbt_clear_stat to common place in wbt_done
blk-wbt: fix comments typo
block/blk-sysfs.c | 5 +---- block/blk-wbt.c | 11 +++-------- 2 files changed, 4 insertions(+), 12 deletions(-)
Signature · 1 line
2.9.4
PATCH 1/5 blk-wbt: remove duplicated setting in wbt_init
rwb->wc and rwb->queue_depth were overwritten by wbt_set_write_cache and wbt_set_queue_depth, remove the default setting.
--- block/blk-wbt.c | 2 -- 1 file changed, 2 deletions(-)
block/blk-wbt.c +0 -2
@@ -723,8 +723,6 @@ int wbt_init(struct request_queue *q)init_waitqueue_head (&rwb->rq_wait[i].wait); } - rwb->wc =1 ; - rwb->queue_depth =RWB_DEF_DEPTH ; rwb->last_comp = rwb->last_issue = jiffies; rwb->queue = q; rwb->win_nsec =RWB_WINDOW_NSEC ;
Signature · 1 line
2.9.4
PATCH 2/5 blk-wbt: cleanup comments to one line
In reply to weiping zhang--- block/blk-wbt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block/blk-wbt.c +1 -3
@@ -729,9 +729,7 @@ int wbt_init(struct request_queue *q) rwb->enable_state =WBT_STATE_ON_DEFAULT ;wbt_update_limits (rwb); -/* -* Assign rwb and add the stats callback. -*/ +/* Assign rwb and add the stats callback. */ q->rq_wb = rwb;blk_stat_add_callback (q, rwb->cb);
Signature · 1 line
2.9.4
PATCH 3/5 blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
In reply to weiping zhangwbt_init doesn't set q->rq_wb to NULL, if wbt_init return 0, so check return value is enough, remove NULL checking.
--- block/blk-sysfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
block/blk-sysfs.c +1 -4
@@ -449,12 +449,9 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page, ret =wbt_init (q);if (ret)return ret; - - rwb = q->rq_wb; -if (!rwb) -return -EINVAL ; } + rwb = q->rq_wb;if (val ==-1 ) rwb->min_lat_nsec =wbt_default_latency_nsec (q);else if (val >=0 )
Signature · 1 line
2.9.4
PATCH 4/5 blk-wbt: move wbt_clear_stat to common place in wbt_done
In reply to weiping zhangwbt_done call wbt_clear_stat no matter current stat was tracked or not, move it to common place.
--- block/blk-wbt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
block/blk-wbt.c +1 -2
@@ -178,12 +178,11 @@ void wbt_done(struct rq_wb *rwb, struct blk_issue_stat *stat)if (wbt_is_read (stat))wb_timestamp (rwb, &rwb->last_comp); -wbt_clear_state (stat); }else {WARN_ON_ONCE (stat == rwb->sync_cookie);__wbt_done (rwb,wbt_stat_to_mask (stat)); -wbt_clear_state (stat); } +wbt_clear_state (stat); }/*
Signature · 1 line
2.9.4
PATCH 5/5 blk-wbt: fix comments typo
In reply to weiping zhang--- block/blk-wbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-wbt.c +1 -1
@@ -481,7 +481,7 @@ static inline unsigned int get_limit(struct rq_wb *rwb, unsigned long rw)/* * At this point we know it's a buffered write. If this is -* kswapd trying to free memory, or REQ_SYNC is set, set, then +* kswapd trying to free memory, or REQ_SYNC is set, then * it's WB_SYNC_ALL writeback, and we'll use the max limit for * that. If the write is marked as a background write, then use * the idle limit, or go to normal if we haven't had competing
Signature · 1 line
2.9.4
Jens Axboe
maintainerQuoted 10 lines · weiping zhang
Hi Jens,
several cleanup for blk-wbt, no function change, thanks
weiping zhang (5):
blk-wbt: remove duplicated setting inwbt_init
blk-wbt: cleanup comments to one line
blk-sysfs: remove NULL pointer checking inqueue_wb_lat_store
blk-wbt: movewbt_clear_statto common place inwbt_done
blk-wbt: fix comments typo
Thanks, looks good - I applied 4, I dropped the comment fixup. It's pointless churn, and there are lots of other comments using that style for one line, even in that same file.
Signature · 1 line
Jens Axboe