All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Fengnan Chang <fengnanchang@gmail.com>,
	linux-block@vger.kernel.org, ming.lei@redhat.com, hare@suse.de,
	hch@lst.de
Cc: Fengnan Chang <changfengnan@bytedance.com>, Yu Kuai <yukuai@fnnas.com>
Subject: Re: [PATCH v2 0/2] blk-mq: use array manage hctx map instead of xarray
Date: Wed, 26 Nov 2025 19:49:25 -0700	[thread overview]
Message-ID: <f7a406c0-ca24-4367-9e0d-fb7bfe91df3d@kernel.dk> (raw)
In-Reply-To: <20251127013908.66118-1-fengnanchang@gmail.com>

On 11/26/25 6:39 PM, Fengnan Chang wrote:
> From: Fengnan Chang <changfengnan@bytedance.com>
> 
> After commit 4e5cc99e1e48 ("blk-mq: manage hctx map via xarray"), we use
> an xarray instead of array to store hctx, but in poll mode, each time
> in blk_mq_poll, we need use xa_load to find corresponding hctx, this
> introduce some costs. In my test, xa_load may cost 3.8% cpu.
> 
> After revert previous change, eliminates the overhead of xa_load and can
> result in a 3% performance improvement.
> 
> potentital use-after-free on q->queue_hw_ctx can be fixed by use rcu to
> avoid, same as Yu Kuai did in [1].
> 
> [1] https://lore.kernel.org/all/20220225072053.2472431-1-yukuai3@huawei.com/
> 
> Fengnan Chang (2):
>   blk-mq: use array manage hctx map instead of xarray
>   blk-mq: fix potential uaf for 'queue_hw_ctx'
> 
>  block/blk-mq-tag.c     |  2 +-
>  block/blk-mq.c         | 63 ++++++++++++++++++++++++++++--------------
>  block/blk-mq.h         | 13 ++++++++-
>  include/linux/blk-mq.h |  3 +-
>  include/linux/blkdev.h |  2 +-
>  5 files changed, 58 insertions(+), 25 deletions(-)
> 
> 
> base-commit: 4941a17751c99e17422be743c02c923ad706f888

Adding correct Yu address, was also wrong for v1 and somehow not
corrected?

-- 
Jens Axboe


  parent reply	other threads:[~2025-11-27  2:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27  1:39 [PATCH v2 0/2] blk-mq: use array manage hctx map instead of xarray Fengnan Chang
2025-11-27  1:39 ` [PATCH v2 1/2] " Fengnan Chang
2025-11-27  1:39 ` [PATCH v2 2/2] blk-mq: fix potential uaf for 'queue_hw_ctx' Fengnan Chang
2025-11-27  3:33   ` Ming Lei
2025-11-27  3:38     ` Ming Lei
2025-11-27 18:46   ` kernel test robot
2025-11-27 20:30   ` kernel test robot
2025-11-27 20:41   ` kernel test robot
2025-11-27 23:32   ` kernel test robot
2025-11-27  2:47 ` [PATCH v2 0/2] blk-mq: use array manage hctx map instead of xarray Jens Axboe
2025-11-27  2:55   ` fengnan chang
2025-11-27  2:49 ` Jens Axboe [this message]
2025-11-27  3:00   ` fengnan chang

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=f7a406c0-ca24-4367-9e0d-fb7bfe91df3d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=changfengnan@bytedance.com \
    --cc=fengnanchang@gmail.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=yukuai@fnnas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.