]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
block: reorganize struct blk_zone_wplug
authorDamien Le Moal <dlemoal@kernel.org>
Tue, 4 Nov 2025 21:22:39 +0000 (06:22 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Nov 2025 15:07:21 +0000 (08:07 -0700)
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 <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-zoned.c

index de3524c17f67f0630f25a29a56cc910777c284f7..d4fc87b0be6b9b93205a7f26f6803a680a6adc7b 100644 (file)
@@ -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)