From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <Bart.VanAssche@wdc.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: "brking@linux.vnet.ibm.com" <brking@linux.vnet.ibm.com>
Subject: Re: [PATCH 3/4] blk-mq: provide internal in-flight variant
Date: Thu, 3 Aug 2017 14:45:23 -0600 [thread overview]
Message-ID: <5fcb20ac-8744-4080-c5a2-d6dad771ee97@kernel.dk> (raw)
In-Reply-To: <1501792912.2922.18.camel@wdc.com>
On 08/03/2017 02:41 PM, Bart Van Assche wrote:
> On Thu, 2017-08-03 at 14:01 -0600, Jens Axboe wrote:
>> We don't have to inc/dec some counter, since we can just
>> iterate the tags. That makes inc/dec a noop, but means we
>> have to iterate busy tags to get an in-flight count.
>> [ ... ]
>> +unsigned int blk_mq_in_flight(struct request_queue *q,
>> + struct hd_struct *part)
>> +{
>> + struct mq_inflight mi = { .part = part, .inflight = 0 };
>
> Hello Jens,
>
> A minor stylistic comment: since a C compiler is required to
> initialize to zero all member variables that have not been initialized
> explicitly I think ".inflight = 0" can be left out.
It can, I'll kill it.
>> diff --git a/block/genhd.c b/block/genhd.c
>> index f735af67a0c9..ad5dc567d57f 100644
>> --- a/block/genhd.c
>> +++ b/block/genhd.c
>> @@ -45,6 +45,35 @@ static void disk_add_events(struct gendisk *disk);
>> static void disk_del_events(struct gendisk *disk);
>> static void disk_release_events(struct gendisk *disk);
>>
>> +void part_inc_in_flight(struct request_queue *q, struct hd_struct *part, int rw)
>> +{
>> + if (q->mq_ops)
>> + return;
>> +
>> + atomic_inc(&part->in_flight[rw]);
>> + if (part->partno)
>> + atomic_inc(&part_to_disk(part)->part0.in_flight[rw]);
>> +}
>> [ ... ]
>> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
>> index 7f7427e00f9c..f2c5096b3a7e 100644
>> --- a/include/linux/genhd.h
>> +++ b/include/linux/genhd.h
>> @@ -362,28 +362,9 @@ static inline void free_part_stats(struct hd_struct *part)
>> #define part_stat_sub(cpu, gendiskp, field, subnd) \
>> part_stat_add(cpu, gendiskp, field, -subnd)
>>
>> -static inline void part_inc_in_flight(struct request_queue *q,
>> - struct hd_struct *part, int rw)
>> -{
>> - atomic_inc(&part->in_flight[rw]);
>> - if (part->partno)
>> - atomic_inc(&part_to_disk(part)->part0.in_flight[rw]);
>> -}
>> [ ... ]
>
> Sorry but to me it seems like this part of the patch does match with
> the patch description? The patch description mentions that inc and dec
> become a noop but it seems to me that these functions have been
> uninlined instead of making these a noop?
The inc/dec goes away for mq, the non-mq path still has to use them. I just
move them as well. Could be a prep patch, but it's just moving the code out
of the header and into a normal C file instead.
--
Jens Axboe
next prev parent reply other threads:[~2017-08-03 20:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 20:01 [PATCH 0/4] block: more scalable inflight tracking Jens Axboe
2017-08-03 20:01 ` [PATCH 1/4] blk-mq-tag: check for NULL rq when iterating tags Jens Axboe
2017-08-03 20:29 ` Bart Van Assche
2017-08-03 20:35 ` Jens Axboe
2017-08-03 20:40 ` Jens Axboe
2017-08-03 20:50 ` Bart Van Assche
2017-08-03 20:56 ` Jens Axboe
2017-08-03 20:01 ` [PATCH 2/4] block: pass in queue to inflight accounting Jens Axboe
2017-08-03 20:35 ` Bart Van Assche
2017-08-03 20:37 ` Jens Axboe
2017-08-03 20:01 ` [PATCH 3/4] blk-mq: provide internal in-flight variant Jens Axboe
2017-08-03 20:41 ` Bart Van Assche
2017-08-03 20:45 ` Jens Axboe [this message]
2017-08-03 20:54 ` Bart Van Assche
2017-08-03 21:25 ` Bart Van Assche
2017-08-03 22:36 ` Jens Axboe
2017-08-04 11:17 ` Ming Lei
2017-08-04 13:55 ` Jens Axboe
2017-08-04 22:19 ` Ming Lei
2017-08-07 19:54 ` Brian King
2017-08-03 20:01 ` [PATCH 4/4] blk-mq: enable checking two part inflight counts at the same time Jens Axboe
2017-08-03 21:29 ` Bart Van Assche
2017-08-03 22:38 ` Jens Axboe
2017-08-03 22:30 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5fcb20ac-8744-4080-c5a2-d6dad771ee97@kernel.dk \
--to=axboe@kernel.dk \
--cc=Bart.VanAssche@wdc.com \
--cc=brking@linux.vnet.ibm.com \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox