public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"damien.lemoal@opensource.wdc.com"
	<damien.lemoal@opensource.wdc.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"vincent.fu@samsung.com" <vincent.fu@samsung.com>
Subject: Re: [PATCH V4 1/8] null_blk: allow REQ_OP_WRITE_ZEROES
Date: Wed, 30 Nov 2022 23:29:00 +0000	[thread overview]
Message-ID: <bebfa1a2-1bf6-b515-00fb-4a7be7eeeae5@nvidia.com> (raw)
In-Reply-To: <20221130075932.nfbxiixykfpxrweh@shindev>

>> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> 
> This motivation sounds good. I tried this patch. With a quick test it looks
> working good for me. Please find minor comments in line.
> 
> [...]
> 
>> +static void null_zero_sector(struct nullb_device *d, sector_t sect,
>> +			     sector_t nr_sects, bool cache)
>> +{
>> +	struct radix_tree_root *root = cache ? &d->cache : &d->data;
>> +	struct nullb_page *t_page;
>> +	unsigned int offset;
>> +	void *dest;
>> +
>> +	t_page = radix_tree_lookup(root, sect >> PAGE_SECTORS_SHIFT);
>> +	if (!t_page)
>> +		return;
>> +
>> +	offset = (sect & SECTOR_MASK) << SECTOR_SHIFT;
>> +	dest = kmap_atomic(t_page->page);
>> +	memset(dest + offset, 0, SECTOR_SIZE * nr_sects);
>> +	kunmap_atomic(dest);
>> +}
> 
> Did you consider to call null_lookup_page() for __null_lookup_page() from
> null_zero_sector()? It may simplify this function a bit.
> 

I found this clear and easy than going over call chain when
debugging.

>> +
>>   static struct nullb_page *null_radix_tree_insert(struct nullb *nullb, u64 idx,

[...]

>>   
>> +static void null_config_write_zeroes(struct nullb *nullb)
>> +{
>> +	if (!nullb->dev->write_zeroes)
>> +		return;
>> +	blk_queue_max_write_zeroes_sectors(nullb->q, UINT_MAX >> 9);
> 
> Just comment: this value UINT_MAX >> 9 sounds a bit weird, but probably ok. This
> value was introduced by commit 306eb6b4ad4f ("nullb: support discard") to call
> blk_queue_max_discard_sectors(). I guess you chose the same value for write
> zeroes.
> 

Yes indeed, plz have a look end patches to allow user to set this value.

-ck


  reply	other threads:[~2022-11-30 23:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 23:28 [PATCH V4 0/7] null_blk: allow REQ_OP_WRITE_ZEROES and cleanup Chaitanya Kulkarni
2022-11-29 23:28 ` [PATCH V4 1/8] null_blk: allow REQ_OP_WRITE_ZEROES Chaitanya Kulkarni
2022-11-30  7:59   ` Shinichiro Kawasaki
2022-11-30 23:29     ` Chaitanya Kulkarni [this message]
2022-12-01  1:21       ` Shinichiro Kawasaki
2022-11-29 23:28 ` [PATCH V4 2/8] null_blk: code cleaup Chaitanya Kulkarni
2022-11-30  8:00   ` Shinichiro Kawasaki
2022-11-29 23:28 ` [PATCH V4 3/8] null_blk: initialize cmd->bio in __alloc_cmd() Chaitanya Kulkarni
2022-11-30  8:01   ` Shinichiro Kawasaki
2022-11-29 23:28 ` [PATCH V4 4/8] null_blk: don't use magic numbers in the code Chaitanya Kulkarni
2022-11-29 23:28 ` [PATCH V4 5/8] null_blk: remove extra space in switch condition Chaitanya Kulkarni
2022-11-29 23:28 ` [PATCH V4 6/8] null_blk: add param to set max disacrd sectors Chaitanya Kulkarni
2022-11-30  8:07   ` Shinichiro Kawasaki
2022-11-29 23:28 ` [PATCH V4 7/8] null_blk: add param to set max write-zeroes sects Chaitanya Kulkarni
2022-11-30  8:09   ` Shinichiro Kawasaki
2022-11-29 23:28 ` [PATCH V4 8/8] null-blk: allow REQ_OP_ZONE_RESET_ALL to configure Chaitanya Kulkarni

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=bebfa1a2-1bf6-b515-00fb-4a7be7eeeae5@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=vincent.fu@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox