Blob Blame History Raw
From: Daniel Wagner <dwagner@suse.de>
Date: Tue, 19 Jul 2022 16:11:13 +0200
Subject: blk-mq: fix kabi support concurrent queue quiesce unquiesce
Patch-mainline: never, kABI fix
References: bsc#1201651

blkdev: struct request_queue is always dynamically allocated hence
no need to ensure the size of the data structure stays the same.

scsi_device: move the new member to the hole after sdev_state. The
whole exists on all 64 bit plattforms because the enum is 4 bytes
and quiesced_by is a pointer aligned to 8 byte boundery.

        /* --- cacheline 32 boundary (2048 bytes) was 16 bytes ago --- */
        enum scsi_device_state     sdev_state;           /*  2064     4 */

        /* XXX 4 bytes hole, try to pack */

        struct task_struct *       quiesced_by;          /*  2072     8 */
        long unsigned int          sdev_data[];          /*  2080     0 */

        /* size: 2080, cachelines: 33, members: 110 */
        /* sum members: 2039, holes: 7, sum holes: 35 */
        /* sum bitfield members: 48 bits (6 bytes) */
        /* forced alignments: 2 */
        /* last cacheline: 32 bytes */

[lduncan: refreshed to apply]
---
 include/linux/blkdev.h     |    6 ++++--
 include/scsi/scsi_device.h |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -561,8 +561,6 @@ struct request_queue {
 	 */
 	struct mutex		mq_freeze_lock;
 
-	int			quiesce_depth;
-
 	struct blk_mq_tag_set	*tag_set;
 	struct list_head	tag_set_list;
 	struct bio_set		bio_split;
@@ -580,6 +578,10 @@ struct request_queue {
 
 #define BLK_MAX_WRITE_HINTS	5
 	u64			write_hints[BLK_MAX_WRITE_HINTS];
+
+#ifndef __GENKSYMS__
+	int			quiesce_depth;
+#endif
 };
 
 /* Keep blk_queue_flag_name[] in sync with the definitions below */
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -215,7 +215,6 @@ struct scsi_device {
 	unsigned no_vpd_size:1;		/* No VPD size reported in header */
 #endif
 
-	unsigned int queue_stopped;	/* request queue is quiesced */
 	bool offline_already;		/* Device offline message logged */
 
 	atomic_t disk_events_disable_depth; /* disable depth for disk events */
@@ -247,6 +246,9 @@ struct scsi_device {
 	unsigned char		access_state;
 	struct mutex		state_mutex;
 	enum scsi_device_state sdev_state;
+#ifndef __GENKSYMS__
+	unsigned int queue_stopped;	/* request queue is quiesced */
+#endif
 	struct task_struct	*quiesced_by;
 	unsigned long		sdev_data[];
 } __attribute__((aligned(sizeof(unsigned long))));