Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1620090rdb; Thu, 7 Dec 2023 04:36:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFaE3oFEQDEGVIVT6cJR9Nt0IKFVR6VCxX1wlQnYzUr0UscogrLoSd6VPc0Afje4pRq93f X-Received: by 2002:a05:6a20:1605:b0:18f:97c:8251 with SMTP id l5-20020a056a20160500b0018f097c8251mr2556413pzj.91.1701952613756; Thu, 07 Dec 2023 04:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701952613; cv=none; d=google.com; s=arc-20160816; b=NZs05y8s4/vvM8prCmXlof/Hmgw+qhaOHh4KAryin04j6PQyHe5pX9aszNC40m5syC 4HDyTY15rqpGqWTj/aYOeH3X0eOJFhTRNfjm3JgqLxd+a6I2Qu/Wpc6GJ485SZk0v0IW 0ZGt2C4VlVIEbikz+2tEFnoH0cNeOfVfpx5zChpGLB2F/nXfYjYm2VWNtJYpwWi/XhfE Nh9lUdnaQ4BII8sDr3b1QSkyb9WyqBTA4lVDbj5BbUyMcC+RAQXk/WYnlvJ6cMSrEhPj 4KISi2SRI9QbM19jFOSPmHk2adBywS4woYZ4msqyGHSIExxqsXMgHtL6V5tEJCxlgBJh OgIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=hBvs7TZQ+nucLVLXIxUZxqkZhSIgkTWTSN7462TSV+g=; fh=DJbT8ne4Efjik5M2lT8AzCh46QRFyMX3tPkPd3UGLh8=; b=iV3jw+UYOe1Etv/5ztq87YtnCNd3lgvzABmYlU2tvTEUaMsprzdg3ys0kIZVv8Bq4T 1KliZ0qzb5T7ruQgx4zEH25NEUDGeTGe8kG4ELtsr6TlMoVjGSEKMbydnZyyxo+EsBJT DYEZIQUwWRHfrLfqlk0Gv94lbZmmTHOyTw+Hkp/rhNQiXSnhdfx0pjrpHWlpygomdQTV Ss/ZSXkPSLJhq1JURzkxgvMZi0u1ItOUx9roG4mC5HSLSfCLILyK5ABED5pwAegynR6G zt/Z3KfoomlFFDO/iIUSx1/womEY4OfIjjOW+39vo0th5kYeItz3UKM68I3F87LKkrMi G+jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZeIt+FIY; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ci4-20020a17090afc8400b00286b86f15bcsi1081199pjb.5.2023.12.07.04.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 04:36:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ZeIt+FIY; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4F2AF8056995; Thu, 7 Dec 2023 04:36:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379443AbjLGMgh (ORCPT + 99 others); Thu, 7 Dec 2023 07:36:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232602AbjLGMg1 (ORCPT ); Thu, 7 Dec 2023 07:36:27 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FCD10D0 for ; Thu, 7 Dec 2023 04:36:33 -0800 (PST) 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-out2.suse.de (Postfix) with ESMTPS id 45C3D1FB5B; Thu, 7 Dec 2023 12:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701952592; 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=hBvs7TZQ+nucLVLXIxUZxqkZhSIgkTWTSN7462TSV+g=; b=ZeIt+FIYVMYMeo9YLHrBBg8tRzTNUSlIdantCyfK4oKtSlPBeDXiiJg+PcWaEMhxtElUgU wSGC9Iv1diomTgpfvqbhLb1ZtZN1hGsfPip3UrGyHVdmXTqDYXOtTYVarqAvaTP+0E0rPX DGysDIWIv2U7n2I73b9Q5XpxWQD+reU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701952592; 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=hBvs7TZQ+nucLVLXIxUZxqkZhSIgkTWTSN7462TSV+g=; b=aTbjMKu3D5F9l5snV5BTh+MbARCzE61MCHmi4JqZcndJDHOGPSbA+bJdBV+2rowcx1Swy5 Ixj8mQCoufa9fdCg== 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 33386139E3; Thu, 7 Dec 2023 12:36:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id XvwOC1C8cWUCAwAAn2gu4w (envelope-from ); Thu, 07 Dec 2023 12:36:32 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Christoph Hellwig , Sagi Grimberg , Hannes Reinecke , Daniel Wagner Subject: [PATCH v4 4/4] nvme: repack struct nvme_ns_head Date: Thu, 7 Dec 2023 13:36:24 +0100 Message-ID: <20231207123624.29959-5-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231207123624.29959-1-dwagner@suse.de> References: <20231207123624.29959-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.30 X-Spamd-Result: default: False [-0.30 / 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]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; 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.00%] X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 07 Dec 2023 04:36:52 -0800 (PST) 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 --- 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