On 12/14/18 12:15 PM, Bart Van Assche wrote:
> On Fri, 2018-12-14 at 19:39 +0800, Ming Lei wrote:
>> This information is helpful to either investigate issues, or understand
>> wbt's internal behaviour.
>>
>> Cc: Bart Van Assche <[email protected]>
>> Cc: Omar Sandoval <[email protected]>
>> Cc: Christoph Hellwig <[email protected]>
>> Cc: Josef Bacik <[email protected]>
>> Signed-off-by: Ming Lei <[email protected]>
>> ---
>>  block/blk-wbt.c | 91 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 91 insertions(+)
>>
>> diff --git a/block/blk-wbt.c b/block/blk-wbt.c
>> index 463e4eb80287..2684bf2d112f 100644
>> --- a/block/blk-wbt.c
>> +++ b/block/blk-wbt.c
>> @@ -715,6 +715,94 @@ void wbt_disable_default(struct request_queue *q)
>>  }
>>  EXPORT_SYMBOL_GPL(wbt_disable_default);
>>  
>> +#ifdef CONFIG_BLK_DEBUG_FS
>> +static int wbt_curr_window_show(void *data, struct seq_file *m)
>> +{
>> +    struct rq_qos *rqos = data;
>> +    struct rq_wb *rwb = RQWB(rqos);
>> +
>> +    seq_printf(m, "%llu ns\n", rwb->cur_win_nsec);
>> +    return 0;
>> +}
> 
> Please consider to embed the unit ("ns") in the attribute name instead of
> in the attribute value. That will make it easier to process this attribute
> in developer debug scripts.
> 
>> +static int wbt_min_latency_show(void *data, struct seq_file *m)
>> +{
>> +    struct rq_qos *rqos = data;
>> +    struct rq_wb *rwb = RQWB(rqos);
>> +
>> +    seq_printf(m, "%luns\n", rwb->min_lat_nsec);
>> +    return 0;
>> +}
> 
> Same comment here about the unit.
> 
>> +static const struct blk_mq_debugfs_attr wbt_debugfs_attrs[] = {
>> +    {"curr_window", 0400, wbt_curr_window_show},
>> +    {"enable_state", 0400, wbt_enable_state_show},
> 
> How about using "enabled" instead of "enable_state"?

Agree on all of these. Ming, I had to amend so I dropped the previous
commits, so I could also drop the compilation fixup for
!CONFIG_BLK_DEBUG_FS. Can you resend with those fixed, and also apply
this incremental?

diff --git a/block/blk-rq-qos.h b/block/blk-rq-qos.h
index fd8a0c5debd3..210567ddfa40 100644
--- a/block/blk-rq-qos.h
+++ b/block/blk-rq-qos.h
@@ -40,9 +40,7 @@ struct rq_qos_ops {
        void (*done_bio)(struct rq_qos *, struct bio *);
        void (*cleanup)(struct rq_qos *, struct bio *);
        void (*exit)(struct rq_qos *);
-#ifdef CONFIG_BLK_DEBUG_FS
        const struct blk_mq_debugfs_attr *debugfs_attrs;
-#endif
 };
 
 struct rq_depth {

-- 
Jens Axboe

Reply via email to