[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2553fcde-43b0-04c0-5f62-9a2c1f9430a1@nvidia.com>
Date: Wed, 5 Oct 2022 05:24:17 +0000
From: Chaitanya Kulkarni <chaitanyak@...dia.com>
To: Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
Chaitanya Kulkarni <chaitanyak@...dia.com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "axboe@...nel.dk" <axboe@...nel.dk>,
"johannes.thumshirn@....com" <johannes.thumshirn@....com>,
"bvanassche@....org" <bvanassche@....org>,
"ming.lei@...hat.com" <ming.lei@...hat.com>,
"shinichiro.kawasaki@....com" <shinichiro.kawasaki@....com>,
"vincent.fu@...sung.com" <vincent.fu@...sung.com>,
"yukuai3@...wei.com" <yukuai3@...wei.com>
Subject: Re: [PATCH 1/6] null_blk: allow write zeores on non-membacked
On 10/4/22 21:54, Damien Le Moal wrote:
> On 10/5/22 12:16, Chaitanya Kulkarni wrote:
>> Add a helper function to enable the REQ_OP_WRITE_ZEROES operations
>> when null_blk is configured with the non-membacked operations.
>>
>> Since write-zeroes is a non-trivial I/O operation we need this to
>> add a blktest so we can test the non-trivial I/O path from the
>> application to the block layer.
>>
>> Signed-off-by: Chaitanya Kulkarni <kch@...dia.com>
>> ---
>> drivers/block/null_blk/main.c | 13 +++++++++++++
>> drivers/block/null_blk/null_blk.h | 1 +
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
>> index 1f154f92f4c2..fc3e883f7b84 100644
>> --- a/drivers/block/null_blk/main.c
>> +++ b/drivers/block/null_blk/main.c
>> @@ -209,6 +209,10 @@ static bool g_discard;
>> module_param_named(discard, g_discard, bool, 0444);
>> MODULE_PARM_DESC(discard, "Support discard operations (requires memory-backed null_blk device). Default: false");
>>
>> +static bool g_write_zeroes;
>> +module_param_named(write_zeroes, g_write_zeroes, bool, 0444);
>> +MODULE_PARM_DESC(write_zeroes, "Support write-zeores operations. Default: false");
>
> Why not make this a number of sectors representing the maximum size of a
> write zero command (blk_queue_max_write_zeroes_sectors()) ? That would
> allow exercising split write zeros BIOs.
>
I kept the implementation identical to the g_discard.
Perhaps it's time to change it so REQ_OP_DISCARD and
REQ_OP_WRITE_ZEROES will have same implementation.
I'll add a discard patch to match your suggested write-zeroes
behavior.
-ck
Powered by blists - more mailing lists