public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Sumit Saxena <sumit.saxena@broadcom.com>
To: 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>,
	Sumit Saxena <sumit.saxena@broadcom.com>
Subject: [PATCH 2/3] block: align nr_active_requests_shared_tags to avoid cache line contention
Date: Thu,  2 Apr 2026 13:16:36 +0530	[thread overview]
Message-ID: <20260402074637.92417-3-sumit.saxena@broadcom.com> (raw)
In-Reply-To: <20260402074637.92417-1-sumit.saxena@broadcom.com>

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;
 
-- 
2.43.7


  parent reply	other threads:[~2026-04-02  7:17 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 ` Sumit Saxena [this message]
2026-04-02 15:54   ` [PATCH 2/3] block: align nr_active_requests_shared_tags to avoid cache line contention Bart Van Assche
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=20260402074637.92417-3-sumit.saxena@broadcom.com \
    --to=sumit.saxena@broadcom.com \
    --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 \
    /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