linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Keith Busch <kbusch@kernel.org>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de>
Subject: [PATCH v4 4/4] nvme: repack struct nvme_ns_head
Date: Thu,  7 Dec 2023 13:36:24 +0100	[thread overview]
Message-ID: <20231207123624.29959-5-dwagner@suse.de> (raw)
In-Reply-To: <20231207123624.29959-1-dwagner@suse.de>

ns_id, lba_shift and ms are always accessed for every read/write I/O in
nvme_setup_rw. By grouping these variables into one cacheline we can
safe some cycles.

4k sequential reads:

           baseline   patched
Bandwidth: 1620       1634
IOPs       66345579   66910939

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/nvme/host/nvme.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 2b31641a97b9..4a4beaecc832 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -445,21 +445,21 @@ struct nvme_ns_head {
 	struct list_head	list;
 	struct srcu_struct      srcu;
 	struct nvme_subsystem	*subsys;
-	unsigned		ns_id;
 	struct nvme_ns_ids	ids;
 	struct list_head	entry;
 	struct kref		ref;
 	bool			shared;
 	int			instance;
 	struct nvme_effects_log *effects;
+	u64			nuse;
+	unsigned		ns_id;
 	int			lba_shift;
 	u16			ms;
 	u16			pi_size;
-	u16			sgs;
-	u32			sws;
-	u64			nuse;
 	u8			pi_type;
 	u8			guard_type;
+	u16			sgs;
+	u32			sws;
 #ifdef CONFIG_BLK_DEV_ZONED
 	u64			zsze;
 #endif
-- 
2.43.0



  parent reply	other threads:[~2023-12-07 12:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 12:36 [PATCH v4 0/4] nvme: add csi, ms and nuse to sysfs Daniel Wagner
2023-12-07 12:36 ` [PATCH v4 1/4] nvme: move ns id info to struct nvme_ns_head Daniel Wagner
2023-12-07 15:31   ` [PATCH v4 0/4] nvme: add csi, ms and nuse to sysfs Christoph Hellwig
2023-12-08  9:10     ` Daniel Wagner
2023-12-07 16:31   ` [PATCH v4 1/4] nvme: move ns id info to struct nvme_ns_head Keith Busch
2023-12-08 13:04     ` Daniel Wagner
2023-12-07 12:36 ` [PATCH v4 2/4] nvme: rename ns attribute group Daniel Wagner
2023-12-07 15:32   ` Christoph Hellwig
2023-12-07 12:36 ` [PATCH v4 3/4] nvme: add csi, ms and nuse to sysfs Daniel Wagner
2023-12-07 12:42   ` Daniel Wagner
2023-12-07 15:33   ` Christoph Hellwig
2023-12-07 16:44   ` Keith Busch
2023-12-08  9:10     ` Daniel Wagner
2023-12-07 12:36 ` Daniel Wagner [this message]
2023-12-07 15:33   ` [PATCH v4 4/4] nvme: repack struct nvme_ns_head Christoph Hellwig

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=20231207123624.29959-5-dwagner@suse.de \
    --to=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).