From: Bart Van Assche <bvanassche@acm.org>
To: Ewan Milne <emilne@redhat.com>
Cc: linux-nvme@lists.infradead.org, tsong@purestorage.com,
jmeneghi@redhat.com, mlombard@redhat.com
Subject: Re: [PATCH 1/3] block: introduce blk_queue_nr_active()
Date: Wed, 27 Sep 2023 07:58:24 -0700 [thread overview]
Message-ID: <b8e19b94-98bb-4250-bd4e-220851c6825b@acm.org> (raw)
In-Reply-To: <CAGtn9r=5DsnsEBUpHxCXwE=r5LR_H5jE+w3yDzUYhYhDp_+_jg@mail.gmail.com>
On 9/27/23 07:49, Ewan Milne wrote:
> On Mon, Sep 25, 2023 at 4:56 PM Bart Van Assche <bvanassche@acm.org> wrote:
>> On 9/25/23 09:31, Ewan D. Milne wrote:
>>> +static inline unsigned int blk_mq_queue_nr_active(struct request_queue *q)
>>> +{
>>> + unsigned int nr_active = 0;
>>> + struct blk_mq_hw_ctx *hctx;
>>> + unsigned long i;
>>> +
>>> + queue_for_each_hw_ctx(q, hctx, i) {
>>> + if (unlikely(blk_mq_is_shared_tags(hctx->flags)))
>>> + return atomic_read(&q->nr_active_requests_shared_tags);
>>> + nr_active += atomic_read(&hctx->nr_active);
>>> + }
>>> + return nr_active;
>>> +}
>>
>> The above function should never be called from any command submission
>> code path. Hence, I think it should be added in a .c file instead of
>> include/linux/blk-mq.h.
>
> The function is only called in one place by the queue-depth nvme path
> selector in a
> later patch in the series, so it is called in the submission path,
> which is why I made it inline.
Hi Ewan,
In order to keep include/linux/blk-mq.h readable and in order to minimize
the kernel compilation time, nontrivial functions that are not called from
the hot path should occur in a .c file instead of in a .h file.
Thanks,
Bart.
next prev parent reply other threads:[~2023-09-27 14:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 16:31 [PATCH 0/3] NVMe multipath path selector enhancements Ewan D. Milne
2023-09-25 16:31 ` [PATCH 1/3] block: introduce blk_queue_nr_active() Ewan D. Milne
2023-09-25 20:56 ` Bart Van Assche
2023-09-27 14:49 ` Ewan Milne
2023-09-27 14:58 ` Bart Van Assche [this message]
2023-09-27 7:36 ` Hannes Reinecke
2023-09-27 11:37 ` Ming Lei
2023-09-27 13:34 ` Ewan Milne
2023-10-03 20:11 ` Uday Shankar
2023-10-04 9:19 ` Sagi Grimberg
2023-09-27 9:49 ` Ming Lei
2023-09-27 13:54 ` Ewan Milne
2023-09-27 10:56 ` Sagi Grimberg
2023-09-27 13:50 ` Ewan Milne
2023-09-28 10:56 ` Sagi Grimberg
2023-09-25 16:31 ` [PATCH 2/3] nvme-multipath: Implement new iopolicy "queue-depth" Ewan D. Milne
2023-09-27 7:38 ` Hannes Reinecke
2023-09-27 11:02 ` Sagi Grimberg
2023-09-27 13:42 ` Ewan Milne
2023-09-25 16:31 ` [PATCH 3/3] nvme-multipath: add "use_nonoptimized" module option Ewan D. Milne
2023-09-27 7:41 ` Hannes Reinecke
2023-09-27 11:31 ` Sagi Grimberg
2023-09-27 13:11 ` John Meneghini
2023-09-27 13:45 ` Ewan Milne
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=b8e19b94-98bb-4250-bd4e-220851c6825b@acm.org \
--to=bvanassche@acm.org \
--cc=emilne@redhat.com \
--cc=jmeneghi@redhat.com \
--cc=linux-nvme@lists.infradead.org \
--cc=mlombard@redhat.com \
--cc=tsong@purestorage.com \
/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