Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp653376pxu; Fri, 11 Dec 2020 10:54:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcrktuebjSmbAfti8i/fP0EkBj5qXf16e5rD+9y+pHWSQoYjNHX+c5FnQN9KK0M5kDQSRf X-Received: by 2002:aa7:d1c2:: with SMTP id g2mr13616645edp.8.1607712891324; Fri, 11 Dec 2020 10:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607712891; cv=none; d=google.com; s=arc-20160816; b=ykyEp7Aw2/MCbHrPmysHiY76lMoWenFXGN1AV8rqD/iMoHYjtcpiHtm+YBKcPWATm1 fuEXSZ44/yrW7qU3uMJBik/njm1JrAkkti+H22voZYzRlZUr25NsRZ3KDMVLpo4Wayzy zcUCTwPzhT3sXJEvkbDjWRg5GcSW2vZsSAnAXrDMzCd2MWSB8KJdX6R6kTc6nrnWh9gn xigFriLPEuhAeOkiLEOeQqWKC1lHjNWOzLVk/IkR96Gs9cKA5yAp7zjUUnFuydy3MYPG lxReyq1aRVAX8owISZJbl2bMR2v88i7DpbE0o302hPzsEoAvDd7HrbwP0Wjp6X7B7Aoz 0y1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=W7UY2I3GoBLSPd0Ton2Uhm7zhxW0pOwaS+4enBrxYLY=; b=WFtsxJrXV2d0LNH4S6dHCJEQ7dtDs+KmyrnijDPXl4bbz7gfashubCIl4h2/anJx9N eQyrjUu0lHRRRXcYja4iNtYpPT04gEjOpP5WDqocaxHpNwBwu913weDVhg6nE2YsivYc pk4Djh3s7shURjBR6Nwje3R7VYsqSa5HI+IXgeGicIp+goYpX9rnQN8S9MnEV19hncVv ziTFLHjrmVcQmSSP8kRKn5rES2ofgr2s560c6cmyusLHPbLbm0ipx3N+Ex6b3gpgJnCO ZuRIR3cObxn6O2I6RWGK9ofLs2djFpMTyGHRJuV2zhE6fj+gW+mEMPQPfPPM1AOhuMGH WM5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NYnYmm6p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mm28si4856440ejb.138.2020.12.11.10.54.22; Fri, 11 Dec 2020 10:54:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NYnYmm6p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405045AbgLKRFw (ORCPT + 99 others); Fri, 11 Dec 2020 12:05:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46600 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394277AbgLKRF3 (ORCPT ); Fri, 11 Dec 2020 12:05:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607706242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W7UY2I3GoBLSPd0Ton2Uhm7zhxW0pOwaS+4enBrxYLY=; b=NYnYmm6pmtEOi0Kpf1bwisd00v1XQX5XDi8bCJfhm7836MZvCKKguUuXvrG0OJVJWSP9hX EqK7StfGMVU0p3TCI81TerKLcAJe3ldJIA/vitzs4ZkYURUzd2Zl6StHI+hyieECNQw7vP K/+ySA+xg4M85i3QPPGbQ6PPnXx6+aU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-y-RRIHHHPgqy5o9pGaoSLA-1; Fri, 11 Dec 2020 12:03:58 -0500 X-MC-Unique: y-RRIHHHPgqy5o9pGaoSLA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDC031934102; Fri, 11 Dec 2020 17:03:55 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77E0F60BD9; Fri, 11 Dec 2020 17:03:55 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 0BBH3t1k028577; Fri, 11 Dec 2020 12:03:55 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 0BBH3q7E028573; Fri, 11 Dec 2020 12:03:52 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 11 Dec 2020 12:03:52 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Johannes Thumshirn cc: SelvaKumar S , "linux-nvme@lists.infradead.org" , "kbusch@kernel.org" , "axboe@kernel.dk" , Damien Le Moal , "hch@lst.de" , "sagi@grimberg.me" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "martin.petersen@oracle.com" , "bvanassche@acm.org" , "hare@suse.de" , "dm-devel@redhat.com" , "snitzer@redhat.com" , "selvajove@gmail.com" , "nj.shetty@samsung.com" , "joshi.k@samsung.com" , "javier.gonz@samsung.com" Subject: Re: [RFC PATCH v3 1/2] block: add simple copy support In-Reply-To: Message-ID: References: <20201211135139.49232-1-selvakuma.s1@samsung.com> <20201211135139.49232-2-selvakuma.s1@samsung.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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