Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp34716pxk; Sat, 29 Aug 2020 15:00:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOtf9ev6u10xPzBNYWXMxFUkqogGoQZfONnYA0a+ALg3LFL5wy2bl74UB/n7gSCpzeWyfh X-Received: by 2002:a17:906:c309:: with SMTP id s9mr428002ejz.167.1598738420095; Sat, 29 Aug 2020 15:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598738420; cv=none; d=google.com; s=arc-20160816; b=E4yYzvshFpkYIZHLoPy6x0rMlH7GA7/7XpjgghxPqsA31Q2NxL1x1WHhujlhI0RKpN cjXCrlLsWlPBHqwAiQJekC1A++rZQzyO5qL93TAIMkf/ejSp1KtpIQPN1QgASkeI125H RADQQrARIJ1XjqqxNcCDj8x7XiPKNEMZ77kixB2dHkIXbv1xRSInAdhefCo7CGWJfFux IHOvADYeW9zLSP5ApxUxKjwaFGLYIx8qC2V4kHeadQYVnZH0aIk3pZTLeMoaakuO8Pd7 G6YR+ng4iKuVBRQKz7tERoFOX9d23bFEF1nLOX58IPqB/dWOOp2qJK4NJKjPOGH7gLJN iSHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=aSvyS+id93OVh4JwogVMxYI/9LBVJ/hSdCzKyqQGRuA=; b=sJ0UyZps/Ol+WZPZHYy+d0m+/En5Y4E/SY04oiWLZoGCwZbj46bCwJW9xpISzzZAXY t2idpwOwLKxKRyQ4GMznWPuPQTMQAlt3l+piLxbYkGn2gnuqhY1qPXKmJ+S4omPLaNq5 zO8hOLbUpynTKOOvFXLBHn0buKrmRxRxDK+UQgAgJ2hYiJ6DwqqR2MXWocM2ReF4e6MX Xl2EgOwcmhdcrMUmlRr4VvRO5+npIg9Sx76Pnx6L/1vkCOeu4TQG3zLfUQsv4/zyBxrr yDxKPAfI2Uixj7ZaQqmISfXnM0bLWR4u07pljCLCIK+jtI7OKlBXLOFPmJpgeykjz2IK CBQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=azZ7LMHL; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn24si2329059edb.307.2020.08.29.14.59.53; Sat, 29 Aug 2020 15:00:20 -0700 (PDT) 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=@nvidia.com header.s=n1 header.b=azZ7LMHL; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728493AbgH2V6t (ORCPT + 99 others); Sat, 29 Aug 2020 17:58:49 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:7605 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgH2V6r (ORCPT ); Sat, 29 Aug 2020 17:58:47 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sat, 29 Aug 2020 14:58:32 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sat, 29 Aug 2020 14:58:46 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sat, 29 Aug 2020 14:58:46 -0700 Received: from [10.2.61.161] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 29 Aug 2020 21:58:45 +0000 Subject: Re: [PATCH v2 2/3] iov_iter: introduce iov_iter_pin_user_pages*() routines To: Christoph Hellwig CC: Andrew Morton , Alexander Viro , Ilya Dryomov , Jens Axboe , , , , , LKML References: <20200829080853.20337-1-jhubbard@nvidia.com> <20200829080853.20337-3-jhubbard@nvidia.com> <20200829145849.GB12470@infradead.org> From: John Hubbard Message-ID: Date: Sat, 29 Aug 2020 14:58:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200829145849.GB12470@infradead.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1598738312; bh=aSvyS+id93OVh4JwogVMxYI/9LBVJ/hSdCzKyqQGRuA=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=azZ7LMHLvdHSTmMoqbkanG4zkj/fKCi5nRHMgQdWdLNBpfQXJPA3PTHAXkjjguSA0 Jtyd6KgTRVlPtQd3wsuGRh6oqfyIyIZdStnwo784JRXEKPA/yM3T4UUOcl2j49RqX0 jfwUGTlHk5Co4swuSNfb+N1BTkhM1GcmHli/Y0dPkshcYN+VHyDzGr1xP3fiPZ5L9D T7iDUrHR1wJP3mwHMOkTqo7hIFy3GPtCz6pNdc9p2oA/llNVMmyX7bTDWx4EFP4oWJ ULq6Cg0Vgo2l0lYIZYE/2Dpq3gmEEYx/wl0jgtnb5qc9u/Q4Dq+Yc4p4oKSWA03WRo etJu1FnSVCC/g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/29/20 7:58 AM, Christoph Hellwig wrote: > On Sat, Aug 29, 2020 at 01:08:52AM -0700, John Hubbard wrote: ... >> @@ -1280,7 +1281,11 @@ static inline ssize_t __pipe_get_pages(struct iov_iter *i, >> maxsize = n; >> n += *start; >> while (n > 0) { >> - get_page(*pages++ = pipe->bufs[iter_head & p_mask].page); >> + if (use_pup) >> + pin_user_page(*pages++ = pipe->bufs[iter_head & p_mask].page); >> + else >> + get_page(*pages++ = pipe->bufs[iter_head & p_mask].page); > > Maybe this would become a little more readable with a local variable > and a little more verbosity: > > struct page *page = pipe->bufs[iter_head & p_mask].page; > > if (use_pup) > pin_user_page(page); > else > get_page(page); > > *pages++ = page; > Yes, that is cleaner, I'll change to that, thanks. thanks, -- John Hubbard NVIDIA