Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp64168rdb; Mon, 18 Dec 2023 09:01:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6AchWI0B0LEF/PLAs6zsrPLyAub3yCuZYpjsLCtQ08aO/k6KIAvYaYHCscfwCHkexqFSL X-Received: by 2002:a50:c046:0:b0:553:434f:d5c6 with SMTP id u6-20020a50c046000000b00553434fd5c6mr1466297edd.48.1702918896240; Mon, 18 Dec 2023 09:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702918896; cv=none; d=google.com; s=arc-20160816; b=jFtsdHr9rTN/5qxG1GVDcmzcjF0JcYHsQ5rV/Z/UNFwwwIGqSf9juJ4ggUndVCtc6o Ch8q3OSejtq1gy0up0OSET2AmHuhcJIDD0fZg6OueykDUt6wUfZv9yJm/cJ3cP1YuUY7 debR/8un3WcfBWudgiuL8QLj9Usdb/E1eSYf1aAhLCsU1auUQpnv0sa41GLkskB+usr4 edzX3UXyfXlDC8E5/pZaxz32qztjiGoayUETbLA7TF4aZmEdeExKSjclpHAH0stnPXrb 2bZTYwqDVbEMxQv43QD13+u8PaOMPqK7Lrsrpttv/NCfeBcR/r1tYKNnbBdvyQdEDkIr 3wAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=jidSXu3GQu1D6ClvnkRcaqOionVtvrMNSab/YE86Yfw=; fh=FwD2YyYv16RA783U5Ue5Ni6CeZPTkmUN4amRjXXIdl8=; b=sHRhXV4nAH5Wd1Geoot8iqZRBcUdrNbTA4FtiR1JDQzR+no2Y8mye5blG8UjY3PxRs UUpzNh00wrjasiOOjfSlTlTQlsYX85KwCCxRIwZ5fGp3vJtrX6i/s+hYklNzj0m67Oho qxbIcXIOQQeJS1qc+PnrVWo2qJXReDkCx3G9XuEvgNEPAYuMB/AuHkcebPbbEyWFZ62S 6chyBB0t5UktKVAJ+B5dXT32M3/f4137dpzG5lAuLyqX/0CCCnH5mecGn4ejjWUDOy6f GdT7RcIZhSHCFSSRB8k0t4O03PZHd2mk5M48x/O2wmThlhsf2DGMa2PF2M9sP8NoWZZR oeRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IrzfwQZD; dkim=neutral (no key) header.i=@suse.de; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Ge0+QLJe; dkim=neutral (no key) header.i=@suse.de header.b=YL5KHqSi; spf=pass (google.com: domain of linux-kernel+bounces-4113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m9-20020a509989000000b005521b594eeasi5330849edb.438.2023.12.18.09.01.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:01:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=IrzfwQZD; dkim=neutral (no key) header.i=@suse.de; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Ge0+QLJe; dkim=neutral (no key) header.i=@suse.de header.b=YL5KHqSi; spf=pass (google.com: domain of linux-kernel+bounces-4113-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F203A1F21BB2 for ; Mon, 18 Dec 2023 17:01:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 343FB5D75F; Mon, 18 Dec 2023 17:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="IrzfwQZD"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hi9dbJO2"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Ge0+QLJe"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="YL5KHqSi" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA4B4FF8A for ; Mon, 18 Dec 2023 17:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EF65921F1E; Mon, 18 Dec 2023 17:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702918803; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jidSXu3GQu1D6ClvnkRcaqOionVtvrMNSab/YE86Yfw=; b=IrzfwQZDhBJ05hQgk53dxDNlzcyp8MYam4FK0GXq0NsG7l6oO7K65J7y2MNi1o1VcqRf3p UkNjR5KvGVxQhBkq4/nxuf+USc6+Otm2CjHaF1+1KWOlchzNKmewQk7xCvbtBW7HL7YYBX SBkRFqXCeIun8B41SMjq7sokBBUDQoA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702918803; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jidSXu3GQu1D6ClvnkRcaqOionVtvrMNSab/YE86Yfw=; b=hi9dbJO2dKzBDZlomQJ1oCYUcD2sbAAuPwogTqH4z9wd2MxEzJv72EJT68ZWUYB+kd0Qto jskf0K9+PrJokNBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702918802; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jidSXu3GQu1D6ClvnkRcaqOionVtvrMNSab/YE86Yfw=; b=Ge0+QLJe5+xal/2d9aT5SX2h+vAzworrENiFFS48UU7GWzIq68ZotDgfLumNENF2yyZCoU DT9hi29edQ9nQGuOjhde+Sm9M+85z8UNETrW1Peat91dH4wfr92ilAjrvr7ufD/UnaARNc CZ8zcagAoeP7xU6qwoNfumN6UEZ6vBA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702918802; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jidSXu3GQu1D6ClvnkRcaqOionVtvrMNSab/YE86Yfw=; b=YL5KHqSiRyHzOqIfm5r2PugeOtcnjh3Umhe9BuhvHakjgluX1z4T/9Diae4IEGLGs0UXzi rbrEJp7iUFSTw7Dw== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id E15C113927; Mon, 18 Dec 2023 17:00:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 4GQONpJ6gGVrDwAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 17:00:02 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Christoph Hellwig , Sagi Grimberg , Hannes Reinecke , Max Gurtovoy , Chaitanya Kulkarni , Daniel Wagner Subject: [PATCH v6 6/6] nvme: repack struct nvme_ns_head Date: Mon, 18 Dec 2023 17:59:54 +0100 Message-ID: <20231218165954.29652-7-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218165954.29652-1-dwagner@suse.de> References: <20231218165954.29652-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 4.90 X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; R_RATELIMIT(0.00)[to_ip_from(RLzwqma61bu69hpd6dkgm7pq7m)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_SEVEN(0.00)[9]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[12.68%] Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: **** X-Spam-Flag: NO 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 Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Daniel Wagner --- 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 6211f18c53c7..3dbd187896d8 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -440,21 +440,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