[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.2012111200490.27753@file01.intranet.prod.int.rdu2.redhat.com>
Date: Fri, 11 Dec 2020 12:03:52 -0500 (EST)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Johannes Thumshirn <Johannes.Thumshirn@....com>
cc: SelvaKumar S <selvakuma.s1@...sung.com>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"kbusch@...nel.org" <kbusch@...nel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>,
Damien Le Moal <Damien.LeMoal@....com>,
"hch@....de" <hch@....de>, "sagi@...mberg.me" <sagi@...mberg.me>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"bvanassche@....org" <bvanassche@....org>,
"hare@...e.de" <hare@...e.de>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"snitzer@...hat.com" <snitzer@...hat.com>,
"selvajove@...il.com" <selvajove@...il.com>,
"nj.shetty@...sung.com" <nj.shetty@...sung.com>,
"joshi.k@...sung.com" <joshi.k@...sung.com>,
"javier.gonz@...sung.com" <javier.gonz@...sung.com>
Subject: Re: [RFC PATCH v3 1/2] block: add simple copy support
On Fri, 11 Dec 2020, Johannes Thumshirn wrote:
> On 11/12/2020 15:57, SelvaKumar S wrote:
> [...]
> > +int blk_copy_emulate(struct block_device *bdev, struct blk_copy_payload *payload,
> > + gfp_t gfp_mask)
> > +{
> > + struct request_queue *q = bdev_get_queue(bdev);
> > + struct bio *bio;
> > + void *buf = NULL;
> > + int i, nr_srcs, max_range_len, ret, cur_dest, cur_size;
> > +
> > + nr_srcs = payload->copy_range;
> > + max_range_len = q->limits.max_copy_range_sectors << SECTOR_SHIFT;
> > + cur_dest = payload->dest;
> > + buf = kvmalloc(max_range_len, GFP_ATOMIC);
>
> Why GFP_ATOMIC and not the passed in gfp_mask? Especially as this is a kvmalloc()
> which has the potential to grow quite big.
You are right, this is confusing.
There's this piece of code at the top of kvmalloc_node:
if ((flags & GFP_KERNEL) != GFP_KERNEL)
return kmalloc_node(size, flags, node);
So, when you use GFP_ATOMIC flag, it will always fall back to kmalloc.
Mikulas
Powered by blists - more mailing lists