public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH 3/3] block: only allocate poll_stats if there's a user of them
Date: Tue, 23 Nov 2021 08:41:32 -0800	[thread overview]
Message-ID: <YZ0ZvJMKlHOjMckv@infradead.org> (raw)
In-Reply-To: <20211123161813.326307-4-axboe@kernel.dk>

On Tue, Nov 23, 2021 at 09:18:13AM -0700, Jens Axboe wrote:
> This is essentially never used, yet it's about 1/3rd of the total
> queue size. Allocate it when needed, and don't embed it in the queue.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>  block/blk-mq.c         | 20 ++++++++++++++++++--
>  block/blk-stat.c       |  6 ------
>  block/blk-sysfs.c      |  1 +
>  include/linux/blkdev.h |  9 +++++++--
>  4 files changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 20a6445f6a01..cb41c441aa8f 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -4577,9 +4577,25 @@ EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
>  /* Enable polling stats and return whether they were already enabled. */
>  static bool blk_poll_stats_enable(struct request_queue *q)
>  {
> -	if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags) ||
> -	    blk_queue_flag_test_and_set(QUEUE_FLAG_POLL_STATS, q))
> +	struct blk_rq_stat *poll_stat;
> +
> +	if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
>  		return true;

Can't we replace the checks for QUEUE_FLAG_POLL_STATS with checks for
q->poll_stat now?

  parent reply	other threads:[~2021-11-23 16:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 16:18 [PATCHSET 0/3] Misc block cleanups Jens Axboe
2021-11-23 16:18 ` [PATCH 1/3] block: move io_context creation into where it's needed Jens Axboe
2021-11-23 16:39   ` Christoph Hellwig
2021-11-23 16:46     ` Jens Axboe
2021-11-23 16:53       ` Jens Axboe
2021-11-23 16:56         ` Christoph Hellwig
2021-11-23 17:04           ` Jens Axboe
2021-11-23 16:18 ` [PATCH 2/3] blk-ioprio: don't set bio priority if not needed Jens Axboe
2021-11-23 16:18 ` [PATCH 3/3] block: only allocate poll_stats if there's a user of them Jens Axboe
2021-11-23 16:21   ` Johannes Thumshirn
2021-11-23 16:27     ` Jens Axboe
2021-11-23 16:41   ` Christoph Hellwig [this message]
2021-11-23 16:44     ` Jens Axboe
2021-11-23 17:05       ` Christoph Hellwig
2021-11-23 17:06         ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2021-11-23 17:10 [PATCHSET 0/3 v2] Misc block cleanups Jens Axboe
2021-11-23 17:10 ` [PATCH 3/3] block: only allocate poll_stats if there's a user of them Jens Axboe
2021-11-23 18:50   ` Christoph Hellwig
2021-11-23 18:58     ` Jens Axboe
2021-11-23 18:59       ` Christoph Hellwig
2021-11-23 19:03         ` Jens Axboe

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=YZ0ZvJMKlHOjMckv@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --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