Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp798541rwi; Thu, 27 Oct 2022 07:42:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77YdILMPFJFNld2j8NAcPAkshH4QGY60QzwEdhbG+TteSfTzevDaw2a4g1mDcrlTG/+7RD X-Received: by 2002:a62:51c3:0:b0:56b:a0e2:3c51 with SMTP id f186-20020a6251c3000000b0056ba0e23c51mr9808960pfb.68.1666881762758; Thu, 27 Oct 2022 07:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666881762; cv=none; d=google.com; s=arc-20160816; b=y1p9EUy8+XUWxVpO04A3nlzqQT2G3cSTk23ggIA3uquhCaHQCUc4HavrnMKKlMny15 4qdQGbNWKfcZrdHxR/+iAq0Qxsm8yzgie6zQgmbp7rQWrHqfZUbUSmZs5qoU4wyJs0uZ sRRO0TbtwwlICUnj3L0IGQ65x0fATc6k+7sI/PL6Zel1r4DYuF22LG+7Ry4IZaGGDHH+ S9VeIlp3SF75M7wTAu8BprH3A7jZSCNxgGjUEUl/ZMSiPcmoFzPDci2tsymbR972PjbP 1ZKN/Lk4cXk3otykWTEvjS3mnJ5GGmajKUEwvNwfkZDGMMhjhhblDlLYAZMcgN34fQ9M Sp8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=LyOCU4xpjTTzBhxH1rdyd7TExb5ifJ5snNn8tAmKhaY=; b=OAHLRNf7AtzgwWqS+OL00ueH1q++V0HjETY1fv1rWeuDaFRn8vG6wsXieY7hMmYiH4 a3G2T13wQyZO75169ADRIwRUb4jb1420tzVJ+sUq3+WIFN5jqdqY+dwDux7P0NCbXmE6 a5U+C2C8lmrscLnttzqnrnTSBpI/N6DT+p9H+A5gmIWLrpxVpcs5ZHzU3yelutTsRtA0 AEloZ4KJ/h6L7qtSOHiqn9eFObmDuuqlWtT1y31VBgrY45AigZF0RX6FMFKZuy5Fif+r cXN8TSmcJczZeCqtDOfrznrF3pC9oP/bufQ5zWE5UCrkT9Cq1rEU8HrNYKjBGsu1J0rM 9NbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=MAQjGDL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a656bc9000000b0044034f3a27bsi1668237pgw.101.2022.10.27.07.42.30; Thu, 27 Oct 2022 07:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=MAQjGDL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234698AbiJ0OXQ (ORCPT + 99 others); Thu, 27 Oct 2022 10:23:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235059AbiJ0OXO (ORCPT ); Thu, 27 Oct 2022 10:23:14 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 728E317C55B; Thu, 27 Oct 2022 07:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=LyOCU4xpjTTzBhxH1rdyd7TExb5ifJ5snNn8tAmKhaY=; b=MAQjGDL+n0Jp7ezjgZqNWaIPdv kbAEpt3r4ap1EWC5XSVaw+OWN25y8+PPt63ZAA/BusDAV9ToTonAcRLlj3w7fE+XaTQBJ7DGoz3EM SciMfLGcUvNFBUwWlWabew4Xe3Nzv082uIYP1utpislLqNawQNXRwtcU7DIddQsndpd99Ljp3ol+v W95zxl5FEpr8Wp9GGLpXq/tdZHIxpM9OetLizn6UBfYQu69h8t0JlJ6xK8wINfYHzqeqgD6tYCDit jMpUoU+WzmqoLrPPWbM/jNu5FXoc8kKf+w89lF6byFO6bjdU12S+7MUCGNmexF+f/TZRFmj7FoNSY AOrYbDQg==; Received: from s0106a84e3fe8c3f3.cg.shawcable.net ([24.64.144.200] helo=[192.168.0.10]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1oo3mi-0012H3-V8; Thu, 27 Oct 2022 08:23:06 -0600 Message-ID: Date: Thu, 27 Oct 2022 08:22:57 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-CA To: Jay Fang , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org Cc: Christoph Hellwig , Greg Kroah-Hartman , Dan Williams , Jason Gunthorpe , =?UTF-8?Q?Christian_K=c3=b6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Stephen Bates References: <20221021174116.7200-1-logang@deltatee.com> <20221021174116.7200-4-logang@deltatee.com> From: Logan Gunthorpe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 24.64.144.200 X-SA-Exim-Rcpt-To: f.fangjian@huawei.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, hch@lst.de, gregkh@linuxfoundation.org, dan.j.williams@intel.com, jgg@ziepe.ca, christian.koenig@amd.com, jhubbard@nvidia.com, ddutile@redhat.com, willy@infradead.org, daniel.vetter@ffwll.ch, dave.b.minturn@intel.com, jason@jlekstrand.net, dave.hansen@linux.intel.com, jianxin.xiong@intel.com, helgaas@kernel.org, ira.weiny@intel.com, robin.murphy@arm.com, martin.oliveira@eideticom.com, ckulkarnilinux@gmail.com, rcampbell@nvidia.com, sbates@raithlin.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH v11 3/9] iov_iter: introduce iov_iter_get_pages_[alloc_]flags() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-10-27 01:11, Jay Fang wrote: > On 2022/10/22 1:41, Logan Gunthorpe wrote: >> Add iov_iter_get_pages_flags() and iov_iter_get_pages_alloc_flags() >> which take a flags argument that is passed to get_user_pages_fast(). >> >> This is so that FOLL_PCI_P2PDMA can be passed when appropriate. >> >> Signed-off-by: Logan Gunthorpe >> Reviewed-by: Christoph Hellwig >> --- >> include/linux/uio.h | 6 ++++++ >> lib/iov_iter.c | 32 ++++++++++++++++++++++++-------- >> 2 files changed, 30 insertions(+), 8 deletions(-) >> >> diff --git a/include/linux/uio.h b/include/linux/uio.h >> index 2e3134b14ffd..9ede533ce64c 100644 >> --- a/include/linux/uio.h >> +++ b/include/linux/uio.h >> @@ -247,8 +247,14 @@ void iov_iter_pipe(struct iov_iter *i, unsigned int direction, struct pipe_inode >> void iov_iter_discard(struct iov_iter *i, unsigned int direction, size_t count); >> void iov_iter_xarray(struct iov_iter *i, unsigned int direction, struct xarray *xarray, >> loff_t start, size_t count); >> +ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, >> + size_t maxsize, unsigned maxpages, size_t *start, >> + unsigned gup_flags); >> ssize_t iov_iter_get_pages2(struct iov_iter *i, struct page **pages, >> size_t maxsize, unsigned maxpages, size_t *start); >> +ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, >> + struct page ***pages, size_t maxsize, size_t *start, >> + unsigned gup_flags); >> ssize_t iov_iter_get_pages_alloc2(struct iov_iter *i, struct page ***pages, >> size_t maxsize, size_t *start); >> int iov_iter_npages(const struct iov_iter *i, int maxpages); >> diff --git a/lib/iov_iter.c b/lib/iov_iter.c >> index c3ca28ca68a6..53efad017f3c 100644 >> --- a/lib/iov_iter.c >> +++ b/lib/iov_iter.c >> @@ -1430,7 +1430,8 @@ static struct page *first_bvec_segment(const struct iov_iter *i, >> >> static ssize_t __iov_iter_get_pages_alloc(struct iov_iter *i, >> struct page ***pages, size_t maxsize, >> - unsigned int maxpages, size_t *start) >> + unsigned int maxpages, size_t *start, >> + unsigned int gup_flags) > > Hi, > found some checkpatch warnings, like this: > WARNING: Prefer 'unsigned int' to bare use of 'unsigned' > #50: FILE: lib/iov_iter.c:1497: > + size_t *start, unsigned gup_flags) We usually stick with the choices of the nearby code instead of the warnings of checkpatch. Thanks, Logan