Re: [PATCH 09/12] sd: convert to the atomic queue limits API
- To: John Garry <john.g.garry@oracle.com>
- Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>, "Martin K. Petersen" <martin.petersen@oracle.com>, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Josef Bacik <josef@toxicpanda.com>, Ilya Dryomov <idryomov@gmail.com>, Dongsheng Yang <dongsheng.yang@easystack.cn>, Roger Pau Monn?? <roger.pau@citrix.com>, linux-um@lists.infradead.org, linux-block@vger.kernel.org, nbd@other.debian.org, ceph-devel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org
- Subject: Re: [PATCH 09/12] sd: convert to the atomic queue limits API
- From: Christoph Hellwig <hch@lst.de>
- Date: Fri, 31 May 2024 07:48:32 +0200
- Message-id: <[🔎] 20240531054832.GB17396@lst.de>
- In-reply-to: <[🔎] 1a1854bb-1f28-44d1-a4ac-30872bd6c3c8@oracle.com>
- References: <[🔎] 20240529050507.1392041-1-hch@lst.de> <[🔎] 20240529050507.1392041-10-hch@lst.de> <[🔎] 1a1854bb-1f28-44d1-a4ac-30872bd6c3c8@oracle.com>
On Thu, May 30, 2024 at 10:16:33AM +0100, John Garry wrote:
>> -static void sd_config_write_same(struct scsi_disk *);
>> +static void sd_config_discard(struct scsi_disk *sdkp, struct queue_limits *lim,
>> + unsigned int mode);
>
> Are there any reasons why we keep forward declarations like this? AFAICS,
> this sd_config_discard forward declaration could be removed.
Mostly to avoid churn. This is a series that needs to feed into the
block tree, so I don't want major churn in sd.c. Maybe after the dust
has settled it would be nice to bring sd.c into a natural order.
>> - blk_queue_max_write_zeroes_sectors(q, sdkp->max_ws_blocks *
>> - (logical_block_size >> 9));
>> + lim->max_write_zeroes_sectors =
>> + sdkp->max_ws_blocks * (logical_block_size >> 9);
>
> Would it be ok to use SECTOR_SHIFT here? A similar change is made in
> sd_config_discard(), above
Sure.
>> + sd_config_discard(sdkp, lim, sd_discard_mode(sdkp));
>> }
>> out:
>> @@ -3278,10 +3290,10 @@ static void sd_read_block_limits_ext(struct scsi_disk *sdkp)
>> }
>> /**
>
> below is not a kernel doc comment
And that is on the one hand intentional to avoid documenting all the
obvious paramters in a local function, but on the other hand requires
removing the double *. Fixed.
>> @@ -3683,28 +3696,33 @@ static int sd_revalidate_disk(struct gendisk
>> *disk)
>> q->limits.max_dev_sectors = logical_to_sectors(sdp, dev_max);
>
>
> is setting q->limits.max_dev_sectors directly proper?
No, and I've already fixed it in my local tree.
Reply to: