From: Bart Van Assche <bvanassche@acm.org>
To: Sumit Saxena <sumit.saxena@broadcom.com>,
martin.petersen@oracle.com, axboe@kernel.dk
Cc: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
mpi3mr-linuxdrv.pdl@broadcom.com,
James Rizzo <james.rizzo@broadcom.com>
Subject: Re: [PATCH 2/3] block: align nr_active_requests_shared_tags to avoid cache line contention
Date: Thu, 2 Apr 2026 08:54:44 -0700 [thread overview]
Message-ID: <1d0d35fe-5e9d-44b7-9dcd-48289f9d9f53@acm.org> (raw)
In-Reply-To: <20260402074637.92417-3-sumit.saxena@broadcom.com>
On 4/2/26 12:46 AM, Sumit Saxena wrote:
> From: James Rizzo <james.rizzo@broadcom.com>
>
> Place nr_active_requests_shared_tags on its own cache line so it does not
> share a cache line with nr_requests and other hot fields, avoiding
> significant performance hits from false sharing on some CPU architectures.
>
> Signed-off-by: James Rizzo <james.rizzo@broadcom.com>
> Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com>
> ---
> include/linux/blkdev.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index d463b9b5a0a5..7ed566c81c1b 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -561,7 +561,9 @@ struct request_queue {
> struct timer_list timeout;
> struct work_struct timeout_work;
>
> - atomic_t nr_active_requests_shared_tags;
> + /* ensure nr_active_requests_shared_tags and nr_requests are on different cache lines
> + to avoid significant performance hits on cache line contention on some CPU architectures */
> + atomic_t nr_active_requests_shared_tags ____cacheline_aligned_in_smp;
>
> struct blk_mq_tags *sched_shared_tags;
>
A possible alternative is this patch that removes
nr_active_requests_shared_tags:
https://lore.kernel.org/linux-block/20240529213921.3166462-1-bvanassche@acm.org/
Thanks,
Bart.
next prev parent reply other threads:[~2026-04-02 15:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 7:46 [PATCH 0/3] scsi/block: NUMA-local allocations and false-sharing fixes Sumit Saxena
2026-04-02 7:46 ` [PATCH 1/3] scsi: use NUMA-local allocation for sdev and starget Sumit Saxena
2026-04-02 7:46 ` [PATCH 2/3] block: align nr_active_requests_shared_tags to avoid cache line contention Sumit Saxena
2026-04-02 15:54 ` Bart Van Assche [this message]
2026-04-09 6:13 ` Sumit Saxena
2026-04-02 7:46 ` [PATCH 3/3] scsi: align scsi_device iodone_cnt " Sumit Saxena
2026-04-02 15:58 ` Bart Van Assche
2026-04-09 6:17 ` Sumit Saxena
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=1d0d35fe-5e9d-44b7-9dcd-48289f9d9f53@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=james.rizzo@broadcom.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
--cc=sumit.saxena@broadcom.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