Message ID | 20250212030055.407090-1-yizhou.tang@shopee.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | blk-wbt: Cleanup some comments | expand |
Hi, 在 2025/02/12 11:00, Tang Yizhou 写道: > From: Tang Yizhou <yizhou.tang@shopee.com> > > wbt_wait() no longer uses a spinlock as a parameter. Update the > function comments accordingly. > > Additionally, revise other comments to ensure they align with the > actual implementation. > > Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com> > --- > block/blk-wbt.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/block/blk-wbt.c b/block/blk-wbt.c > index 6dfc659d22e2..f1754d07f7e0 100644 > --- a/block/blk-wbt.c > +++ b/block/blk-wbt.c > @@ -136,8 +136,9 @@ enum { > RWB_MIN_WRITE_SAMPLES = 3, > > /* > - * If we have this number of consecutive windows with not enough > - * information to scale up or down, scale up. > + * If we have this number of consecutive windows without enough > + * information to scale up or down, slowly return to center state > + * (step == 0). > */ > RWB_UNKNOWN_BUMP = 5, > }; > @@ -446,9 +447,9 @@ static void wb_timer_fn(struct blk_stat_callback *cb) > break; > case LAT_UNKNOWN_WRITES: > /* > - * We started a the center step, but don't have a valid > - * read/write sample, but we do have writes going on. > - * Allow step to go negative, to increase write perf. > + * We don't have a valid read/write sample, but we do have > + * writes going on. Allow step to go negative, to increase > + * write performance. Other than this clean up, the others are actually fix. Can you remove this one and change the title to "Fix some comments"? Thanks, Kuai > */ > scale_up(rwb); > break; > @@ -638,11 +639,7 @@ static void wbt_cleanup(struct rq_qos *rqos, struct bio *bio) > __wbt_done(rqos, flags); > } > > -/* > - * May sleep, if we have exceeded the writeback limits. Caller can pass > - * in an irq held spinlock, if it holds one when calling this function. > - * If we do sleep, we'll release and re-grab it. > - */ > +/* May sleep, if we have exceeded the writeback limits. */ > static void wbt_wait(struct rq_qos *rqos, struct bio *bio) > { > struct rq_wb *rwb = RQWB(rqos); >
On Thu, Feb 13, 2025 at 10:56 AM Yu Kuai <yukuai1@huaweicloud.com> wrote: > > Hi, > > 在 2025/02/12 11:00, Tang Yizhou 写道: > > From: Tang Yizhou <yizhou.tang@shopee.com> > > > > wbt_wait() no longer uses a spinlock as a parameter. Update the > > function comments accordingly. > > > > Additionally, revise other comments to ensure they align with the > > actual implementation. > > > > Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com> > > --- > > block/blk-wbt.c | 17 +++++++---------- > > 1 file changed, 7 insertions(+), 10 deletions(-) > > > > diff --git a/block/blk-wbt.c b/block/blk-wbt.c > > index 6dfc659d22e2..f1754d07f7e0 100644 > > --- a/block/blk-wbt.c > > +++ b/block/blk-wbt.c > > @@ -136,8 +136,9 @@ enum { > > RWB_MIN_WRITE_SAMPLES = 3, > > > > /* > > - * If we have this number of consecutive windows with not enough > > - * information to scale up or down, scale up. > > + * If we have this number of consecutive windows without enough > > + * information to scale up or down, slowly return to center state > > + * (step == 0). > > */ > > RWB_UNKNOWN_BUMP = 5, > > }; > > @@ -446,9 +447,9 @@ static void wb_timer_fn(struct blk_stat_callback *cb) > > break; > > case LAT_UNKNOWN_WRITES: > > /* > > - * We started a the center step, but don't have a valid > > - * read/write sample, but we do have writes going on. > > - * Allow step to go negative, to increase write perf. > > + * We don't have a valid read/write sample, but we do have > > + * writes going on. Allow step to go negative, to increase > > + * write performance. > > Other than this clean up, the others are actually fix. Can you remove > this one and change the title to "Fix some comments"? > > Thanks, > Kuai > Will do. Thanks Yi > > */ > > scale_up(rwb); > > break; > > @@ -638,11 +639,7 @@ static void wbt_cleanup(struct rq_qos *rqos, struct bio *bio) > > __wbt_done(rqos, flags); > > } > > > > -/* > > - * May sleep, if we have exceeded the writeback limits. Caller can pass > > - * in an irq held spinlock, if it holds one when calling this function. > > - * If we do sleep, we'll release and re-grab it. > > - */ > > +/* May sleep, if we have exceeded the writeback limits. */ > > static void wbt_wait(struct rq_qos *rqos, struct bio *bio) > > { > > struct rq_wb *rwb = RQWB(rqos); > > > >
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 6dfc659d22e2..f1754d07f7e0 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -136,8 +136,9 @@ enum { RWB_MIN_WRITE_SAMPLES = 3, /* - * If we have this number of consecutive windows with not enough - * information to scale up or down, scale up. + * If we have this number of consecutive windows without enough + * information to scale up or down, slowly return to center state + * (step == 0). */ RWB_UNKNOWN_BUMP = 5, }; @@ -446,9 +447,9 @@ static void wb_timer_fn(struct blk_stat_callback *cb) break; case LAT_UNKNOWN_WRITES: /* - * We started a the center step, but don't have a valid - * read/write sample, but we do have writes going on. - * Allow step to go negative, to increase write perf. + * We don't have a valid read/write sample, but we do have + * writes going on. Allow step to go negative, to increase + * write performance. */ scale_up(rwb); break; @@ -638,11 +639,7 @@ static void wbt_cleanup(struct rq_qos *rqos, struct bio *bio) __wbt_done(rqos, flags); } -/* - * May sleep, if we have exceeded the writeback limits. Caller can pass - * in an irq held spinlock, if it holds one when calling this function. - * If we do sleep, we'll release and re-grab it. - */ +/* May sleep, if we have exceeded the writeback limits. */ static void wbt_wait(struct rq_qos *rqos, struct bio *bio) { struct rq_wb *rwb = RQWB(rqos);