Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Damien Le Moal <Damien.LeMoal@wdc.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>,
	"linux-f2fs-devel@lists.sourceforge.net" 
	<linux-f2fs-devel@lists.sourceforge.net>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <yuchao0@huawei.com>
Subject: Re: [dm-devel] [PATCH 8/9] scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer()
Date: Fri, 8 Nov 2019 19:02:26 -0800
Message-ID: <639eae70-bb57-0c49-0ae9-aed8d33df271@acm.org> (raw)
In-Reply-To: <BYAPR04MB5816C442BE08F9973C2CDF15E77A0@BYAPR04MB5816.namprd04.prod.outlook.com>

On 2019-11-08 18:54, Damien Le Moal wrote:
> On 2019/11/09 4:06, Bart Van Assche wrote:
>> On 11/7/19 5:57 PM, Damien Le Moal wrote:
>>> -	buf = vzalloc(bufsize);
>>> -	if (buf)
>>> -		*buflen = bufsize;
>>> +	while (bufsize >= SECTOR_SIZE) {
>>> +		buf = vzalloc(bufsize);
>>> +		if (buf) {
>>> +			*buflen = bufsize;
>>> +			return buf;
>>> +		}
>>> +		bufsize >>= 1;
>>> +	}
>>
>> Hi Damien,
>>
>> Has it been considered to pass the __GFP_NORETRY flag to this vzalloc() 
>> call?
> 
> Do you mean using
> 
> __vmalloc(bufsize,
> 	  GFP_KERNEL | __GFP_ZERO | __GFP_NORETRY, PAGE_KERNEL);
> 
> instead of vzalloc() ? (since we cannot pass GFP flags to vzalloc()...)
> 
> Note that this is called with GFP_NOIO set for the caller context in the
> case of revalidate zones, and default to GFP_KERNEL for
> blkdev_report_zones() unless the caller also tweaks the context memalloc
> flags.

Hi Damien,

Yes, that's what I meant. The following comment from mm/util.c explains
why __GFP_RETRY should be used if it is OK for an allocation to fail:

/*
 * We want to attempt a large physically contiguous block first because
 * it is less likely to fragment multiple larger blocks and therefore
 * contribute to a long term fragmentation less than vmalloc fallback.
 * However make sure that larger requests are not too disruptive - no
 * OOM killer and no allocation failure warnings as we have a fallback.
 */

Thanks,

Bart.

  reply index

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08  1:56 [PATCH 0/9] Zoned block device enhancements and zone report rework Damien Le Moal
2019-11-08  1:56 ` [PATCH 1/9] block: Enhance blk_revalidate_disk_zones() Damien Le Moal
2019-11-08  6:28   ` [dm-devel] " Christoph Hellwig
2019-11-08  7:10   ` Hannes Reinecke
2019-11-08  1:56 ` [PATCH 2/9] block: cleanup the !zoned case in blk_revalidate_disk_zones Damien Le Moal
2019-11-08  7:11   ` Hannes Reinecke
2019-11-08 18:50   ` Chaitanya Kulkarni
2019-11-08  1:56 ` [PATCH 3/9] block: Simplify report zones execution Damien Le Moal
2019-11-08  7:12   ` Hannes Reinecke
2019-11-08  1:56 ` [PATCH 4/9] block: Remove partition support for zoned block devices Damien Le Moal
2019-11-08  6:30   ` [dm-devel] " Christoph Hellwig
2019-11-08  7:17   ` Hannes Reinecke
2019-11-08  7:28     ` Damien Le Moal
2019-11-08  1:56 ` [PATCH 5/9] null_blk: clean up the block device operations Damien Le Moal
2019-11-08  7:17   ` Hannes Reinecke
2019-11-08 18:47   ` Chaitanya Kulkarni
2019-11-08  1:56 ` [PATCH 6/9] null_blk: clean up report zones Damien Le Moal
2019-11-08  7:18   ` Hannes Reinecke
2019-11-08 18:47   ` Chaitanya Kulkarni
2019-11-08  1:57 ` [PATCH 7/9] null_blk: Add zone_nr_conv to features Damien Le Moal
2019-11-08  7:18   ` Hannes Reinecke
2019-11-08 18:48   ` Chaitanya Kulkarni
2019-11-08  1:57 ` [PATCH 8/9] scsi: sd_zbc: Cleanup sd_zbc_alloc_report_buffer() Damien Le Moal
2019-11-08  6:31   ` [dm-devel] " Christoph Hellwig
2019-11-08  7:20   ` Hannes Reinecke
2019-11-08 19:06   ` [dm-devel] " Bart Van Assche
2019-11-09  2:54     ` Damien Le Moal
2019-11-09  3:02       ` Bart Van Assche [this message]
2019-11-08  1:57 ` [PATCH 9/9] block: rework zone reporting Damien Le Moal
2019-11-08  7:23   ` Hannes Reinecke
2019-11-08 15:16   ` Mike Snitzer

Reply instructions:

You may reply publically 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=639eae70-bb57-0c49-0ae9-aed8d33df271@acm.org \
    --to=bvanassche@acm.org \
    --cc=Damien.LeMoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=snitzer@redhat.com \
    --cc=yuchao0@huawei.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

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git