All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	virtualization@lists.linux.dev, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 01/14] block: move max_{open,active}_zones to struct queue_limits
Date: Wed, 31 Jan 2024 14:03:47 +0100	[thread overview]
Message-ID: <20240131130400.625836-2-hch@lst.de> (raw)
In-Reply-To: <20240131130400.625836-1-hch@lst.de>

The maximum number of open and active zones is a limit on the queue
and should be places there so that we can including it in the upcoming
queue limits batch update API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 include/linux/blkdev.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 99e4f5e722132c..4a2e82c7971c86 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -189,8 +189,6 @@ struct gendisk {
 	 * blk_mq_unfreeze_queue().
 	 */
 	unsigned int		nr_zones;
-	unsigned int		max_open_zones;
-	unsigned int		max_active_zones;
 	unsigned long		*conv_zones_bitmap;
 	unsigned long		*seq_zones_wlock;
 #endif /* CONFIG_BLK_DEV_ZONED */
@@ -307,6 +305,8 @@ struct queue_limits {
 	unsigned char		discard_misaligned;
 	unsigned char		raid_partial_stripes_expensive;
 	bool			zoned;
+	unsigned int		max_open_zones;
+	unsigned int		max_active_zones;
 
 	/*
 	 * Drivers that set dma_alignment to less than 511 must be prepared to
@@ -639,23 +639,23 @@ static inline bool disk_zone_is_seq(struct gendisk *disk, sector_t sector)
 static inline void disk_set_max_open_zones(struct gendisk *disk,
 		unsigned int max_open_zones)
 {
-	disk->max_open_zones = max_open_zones;
+	disk->queue->limits.max_open_zones = max_open_zones;
 }
 
 static inline void disk_set_max_active_zones(struct gendisk *disk,
 		unsigned int max_active_zones)
 {
-	disk->max_active_zones = max_active_zones;
+	disk->queue->limits.max_active_zones = max_active_zones;
 }
 
 static inline unsigned int bdev_max_open_zones(struct block_device *bdev)
 {
-	return bdev->bd_disk->max_open_zones;
+	return bdev->bd_disk->queue->limits.max_open_zones;
 }
 
 static inline unsigned int bdev_max_active_zones(struct block_device *bdev)
 {
-	return bdev->bd_disk->max_active_zones;
+	return bdev->bd_disk->queue->limits.max_active_zones;
 }
 
 #else /* CONFIG_BLK_DEV_ZONED */
-- 
2.39.2


  reply	other threads:[~2024-01-31 13:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 13:03 atomic queue limits updates v3 Christoph Hellwig
2024-01-31 13:03 ` Christoph Hellwig [this message]
2024-01-31 23:10   ` [PATCH 01/14] block: move max_{open,active}_zones to struct queue_limits Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 02/14] block: refactor disk_update_readahead Christoph Hellwig
2024-01-31 23:11   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 03/14] block: add an API to atomically update queue limits Christoph Hellwig
2024-01-31 23:14   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 04/14] block: use queue_limits_commit_update in queue_max_sectors_store Christoph Hellwig
2024-01-31 23:18   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 05/14] block: add a max_user_discard_sectors queue limit Christoph Hellwig
2024-01-31 23:28   ` Chaitanya Kulkarni
2024-02-01  0:36   ` Keith Busch
2024-02-01  4:18     ` Christoph Hellwig
2024-01-31 13:03 ` [PATCH 06/14] block: use queue_limits_commit_update in queue_discard_max_store Christoph Hellwig
2024-01-31 23:29   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 07/14] block: pass a queue_limits argument to blk_alloc_queue Christoph Hellwig
2024-01-31 23:32   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 08/14] block: pass a queue_limits argument to blk_mq_init_queue Christoph Hellwig
2024-01-31 23:33   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 09/14] block: pass a queue_limits argument to blk_mq_alloc_disk Christoph Hellwig
2024-01-31 23:36   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 10/14] virtio_blk: split virtblk_probe Christoph Hellwig
2024-01-31 13:03 ` [PATCH 11/14] virtio_blk: pass queue_limits to blk_mq_alloc_disk Christoph Hellwig
2024-01-31 23:37   ` Chaitanya Kulkarni
2024-01-31 13:03 ` [PATCH 12/14] loop: cleanup loop_config_discard Christoph Hellwig
2024-01-31 13:03 ` [PATCH 13/14] loop: pass queue_limits to blk_mq_alloc_disk Christoph Hellwig
2024-01-31 23:38   ` Chaitanya Kulkarni
2024-01-31 13:04 ` [PATCH 14/14] loop: use the atomic queue limits update API Christoph Hellwig
2024-01-31 23:38   ` Chaitanya Kulkarni
2024-01-31 23:26 ` atomic queue limits updates v3 Martin K. Petersen
2024-02-01  7:04   ` Christoph Hellwig
2024-02-01  3:24 ` Ming Lei
2024-02-01  7:10 ` Christoph Hellwig
2024-02-08 18:29   ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2024-01-28 16:57 atomic queue limits updates v2 Christoph Hellwig
2024-01-28 16:58 ` [PATCH 01/14] block: move max_{open,active}_zones to struct queue_limits Christoph Hellwig
2024-01-28 23:32   ` Bart Van Assche
2024-01-29  6:15     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131130400.625836-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=jasowang@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.