Re: [PATCH 7/9] zram: use the default discard granularity
- To: Sergey Senozhatsky <senozhatsky@chromium.org>, Christoph Hellwig <hch@lst.de>
- Cc: Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Josef Bacik <josef@toxicpanda.com>, Minchan Kim <minchan@kernel.org>, Coly Li <colyli@suse.de>, Miquel Raynal <miquel.raynal@bootlin.com>, Vignesh Raghavendra <vigneshr@ti.com>, linux-um@lists.infradead.org, linux-block@vger.kernel.org, nbd@other.debian.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org
- Subject: Re: [PATCH 7/9] zram: use the default discard granularity
- From: Jens Axboe <axboe@kernel.dk>
- Date: Tue, 2 Jan 2024 08:44:05 -0700
- Message-id: <[🔎] f3758a5a-986f-485c-9a6b-c11af20c3aa5@kernel.dk>
- In-reply-to: <[🔎] 400dbdbf-e99e-4747-94db-54fb6674fdd5@kernel.dk>
- References: <20231228075545.362768-1-hch@lst.de> <20231228075545.362768-8-hch@lst.de> <[🔎] 20240102011543.GA21409@google.com> <[🔎] 400dbdbf-e99e-4747-94db-54fb6674fdd5@kernel.dk>
On 1/2/24 8:40 AM, Jens Axboe wrote:
> On 1/1/24 6:15 PM, Sergey Senozhatsky wrote:
>> On (23/12/28 07:55), Christoph Hellwig wrote:
>>>
>>> The discard granularity now defaults to a single sector, so don't set
>>> that value explicitly
>>
>> Hmm, but sector size != PAGE_SIZE
>>
>> [..]
>>
>>> @@ -2227,7 +2227,6 @@ static int zram_add(void)
>>> ZRAM_LOGICAL_BLOCK_SIZE);
>>> blk_queue_io_min(zram->disk->queue, PAGE_SIZE);
>>> blk_queue_io_opt(zram->disk->queue, PAGE_SIZE);
>>> - zram->disk->queue->limits.discard_granularity = PAGE_SIZE;
>
> Yep, that does indeed look buggy.
Ah no it's fine, it'll default to the sector size of the device, which
is set before the discard limit/granularity. So should work fine as-is.
--
Jens Axboe
Reply to: