Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1785108rwe; Sat, 27 Aug 2022 17:26:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DqtYNe/eeyQoTIQPVtYLGtJ+6lA1lQjaYSt+Ey0DDb/R7tHNDfIjWew90KZFPDD5Lz4Wj X-Received: by 2002:a05:6402:4003:b0:448:4c79:45e2 with SMTP id d3-20020a056402400300b004484c7945e2mr1346923eda.376.1661646400976; Sat, 27 Aug 2022 17:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661646400; cv=none; d=google.com; s=arc-20160816; b=ny9weU3lPxRrYAoghTJyVjWs8C94/SAkcLigWBsDIorD/cCr6it9OM05MIMaOUOpS2 YP/oqE529hffsCSSzVmwVtxpKJxlD8wGT2b7jnE9hBHULo4RUiJXuflIamo47f8bIXJO AtV5MMsNBAEgzOPlRcxH5N+90ZhyVvzuxN9g0TW0VFKvDdcNzemK0czZ6xPCWuNtINVW p5MULSVsZv+DtcyZWtewr8dN2BdzeBWYK8VDAvlSg1BQoo7zFffgS7vM2+YhGz1k7yI8 AW2GRNGhzzmAYCthoqudb10UrSQ2RKX/tDa11S8360M5A89GQYXb9PZ/V6xPXk0xHbXg mN0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Bpb+O5xBVwlyF4LW0dhUD8HaKYLuY4sKDEQDcybQZqg=; b=c3Cny0ZAkukV1WdCtDIsTrXCmmaoazfmVN2K5iEjcQYQLiTkMAEUP+swrMMWbs4xrm GNFeP0tBEt3fO2qq/Equ6njlsUiuYzkg61q6qOnE20CKUk/NlhXli1KSxqj2s1wR7Hio IxoXzP0XbxzmhpeIzSmRgRAhsec5qNeQxQHIA0BimvIpGEKdje7wnOs60Q4itzSYNY9X NVzRyLY3iTxZpSbobN7edVQKjub/oDdt+53cWYDEuiOj9sxBptWk9IyvCuGMdmLnKyAf Cb7u2rt61KMbyM5ID0Kp0rl7HDTcxCU5dQ81pg38iSZwRlFu0Dr05Vug/tsgIhd5xmH5 iHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=TMpAOVjb; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a50cd83000000b00442c272f4f7si3887099edi.537.2022.08.27.17.26.17; Sat, 27 Aug 2022 17:26:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@linux-foundation.org header.s=korg header.b=TMpAOVjb; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbiH1AMY (ORCPT + 99 others); Sat, 27 Aug 2022 20:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiH1AMX (ORCPT ); Sat, 27 Aug 2022 20:12:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86931AD83; Sat, 27 Aug 2022 17:12:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F66160EFF; Sun, 28 Aug 2022 00:12:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8E9FC433C1; Sun, 28 Aug 2022 00:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661645541; bh=pKUoaQ9EcjJggSkeqY7Olvpsm3d5dLwR/wl/BB+U5g8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TMpAOVjbK9E3fz0ooSfvWL268lrlX3TxQoLp4an1G52borowaZOgsBN4HTAMzlSZh n/go2Bd+b/Q7boVjtKX7sXTsnaPBkr/ToNRad4gXMu3cYY9wSWwQXUZhWqQKOjm5Zr f0vMAg/QZlaEUyt8kktBXmYn5/Sp4RnqSXTXzcwA= Date: Sat, 27 Aug 2022 17:12:20 -0700 From: Andrew Morton To: John Hubbard Cc: Jens Axboe , Alexander Viro , Miklos Szeredi , Christoph Hellwig , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , Jan Kara , Logan Gunthorpe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH 2/6] block: add dio_w_*() wrappers for pin, unpin user pages Message-Id: <20220827171220.fa2f21f6b22c6d3047857381@linux-foundation.org> In-Reply-To: <4c6903d4-0612-5097-0005-4a9420890826@nvidia.com> References: <20220827083607.2345453-1-jhubbard@nvidia.com> <20220827083607.2345453-3-jhubbard@nvidia.com> <20220827152745.3dcd05e98b3a4383af650a72@linux-foundation.org> <4c6903d4-0612-5097-0005-4a9420890826@nvidia.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, 27 Aug 2022 16:59:32 -0700 John Hubbard wrote: > Anyway, I'll change my patch locally for now, to this: > > static inline void dio_w_unpin_user_pages(struct page **pages, > unsigned long npages) > { > /* Careful, release_pages() uses a smaller integer type for npages: */ > if (WARN_ON_ONCE(npages > (unsigned long)INT_MAX)) > return; > > release_pages(pages, (int)npages); > } Well, it might be slower. release_pages() has a ton of fluff. As mentioned, the above might be faster if the pages tend to have page_count()==1??