From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28EECCCFA03 for ; Tue, 4 Nov 2025 01:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=spjYC26QclR/UG6YkrOGyDRhWnWPVk150awTRPVuEcs=; b=SR65z9Pmeo6VfqOh6mX3u97oNL 6IG/sDd9ZsdohWaxQ1RTQKWac9E4InmvxSz0/y20P8C6SLMtYMGYCOPhRYtX9KzMjt/v1MpXW1MbV g3dfoj03xP7+zr+GjdJ54gX16HJHmxDpSvwT/pQiZCQ0gxpSF49Pvw2Be85TfyN0lLIqZhk6s705C xJvukVsr1CiphvkKb92CNL0kwZXC+2hdjG8WwOePpsMvHCK8XYbLnz1gyNDcZ2Ap4gvUVA8ABfbUM IdJu3FbsSFzyfEcMfcxY14yIFmCvVd/MprF0T2kU0p/iUFObtM1tJt7bmHUHw4jI7yAjynN/LKk3K o/eFBOOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vG5xi-0000000AuIs-1zwb; Tue, 04 Nov 2025 01:35:54 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vG5xf-0000000AuGJ-0zdt for linux-nvme@lists.infradead.org; Tue, 04 Nov 2025 01:35:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 8686A43F3A; Tue, 4 Nov 2025 01:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03837C16AAE; Tue, 4 Nov 2025 01:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762220150; bh=IEl/o1R4ZMpbrO/F9SVsVKhT3QYFCOCgLXgkAfgAfUM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gtxmEWP/ngWMTFLMn/0vM5bmcpxkYhYDB53UrYiJVl5xaTuk+Qk/bYv1iwcha5mlA DWHngIiaLKFkqVXIM6UFnCzXkvIL9ndBSyeFSeXcLz8jt1enq5wsm2lY4t9OLpY2CP Xz2TJmdpvQLZXXMWxWLYqRQUjP/aofTbWFCadikQsoMWdCUZ7mRKTuOX6FTsMURRrx //sj4V7m4x9Rv+4+9DZojMG3+RBREKZOZkaXwxD+raHjx4awTRegqNDB8AoCkX38BT wowj1BXw0hUdEq/qj9DoCxi3i5FP6nOmdGpA9LrgyUk9hQtPHC60yckAtf0UeNwYwm /06GAoO9FZ1KA== From: Damien Le Moal To: Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Keith Busch , Christoph Hellwig , dm-devel@lists.linux.dev, Mike Snitzer , Mikulas Patocka , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-xfs@vger.kernel.org, Carlos Maiolino , linux-btrfs@vger.kernel.org, David Sterba Subject: [PATCH v3 05/15] block: reorganize struct blk_zone_wplug Date: Tue, 4 Nov 2025 10:31:37 +0900 Message-ID: <20251104013147.913802-6-dlemoal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251104013147.913802-1-dlemoal@kernel.org> References: <20251104013147.913802-1-dlemoal@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251103_173551_320093_FEB3976A X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org Reorganize the fields of struct blk_zone_wplug to remove a hole after the wp_offset field and avoid having the bio_work structure split between 2 cache lines. No functional changes. Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn --- block/blk-zoned.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index de3524c17f67..d4fc87b0be6b 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -39,6 +39,11 @@ static const char *const zone_cond_name[] = { /* * Per-zone write plug. * @node: hlist_node structure for managing the plug using a hash table. + * @bio_list: The list of BIOs that are currently plugged. + * @bio_work: Work struct to handle issuing of plugged BIOs + * @rcu_head: RCU head to free zone write plugs with an RCU grace period. + * @disk: The gendisk the plug belongs to. + * @lock: Spinlock to atomically manipulate the plug. * @ref: Zone write plug reference counter. A zone write plug reference is * always at least 1 when the plug is hashed in the disk plug hash table. * The reference is incremented whenever a new BIO needing plugging is @@ -48,27 +53,22 @@ static const char *const zone_cond_name[] = { * reference is dropped whenever the zone of the zone write plug is reset, * finished and when the zone becomes full (last write BIO to the zone * completes). - * @lock: Spinlock to atomically manipulate the plug. * @flags: Flags indicating the plug state. * @zone_no: The number of the zone the plug is managing. * @wp_offset: The zone write pointer location relative to the start of the zone * as a number of 512B sectors. - * @bio_list: The list of BIOs that are currently plugged. - * @bio_work: Work struct to handle issuing of plugged BIOs - * @rcu_head: RCU head to free zone write plugs with an RCU grace period. - * @disk: The gendisk the plug belongs to. */ struct blk_zone_wplug { struct hlist_node node; - refcount_t ref; - spinlock_t lock; - unsigned int flags; - unsigned int zone_no; - unsigned int wp_offset; struct bio_list bio_list; struct work_struct bio_work; struct rcu_head rcu_head; struct gendisk *disk; + spinlock_t lock; + refcount_t ref; + unsigned int flags; + unsigned int zone_no; + unsigned int wp_offset; }; static inline unsigned int disk_zone_wplugs_hash_size(struct gendisk *disk) -- 2.51.0