Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3112347pxb; Fri, 4 Feb 2022 01:21:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3v25Vm/VZUMXpwn8CztMHFGgkc4074BYnWadLVeXzvYkfVvwaLBJqBEUWVGs61BN7tPJa X-Received: by 2002:a17:902:cec8:: with SMTP id d8mr2062538plg.98.1643966502487; Fri, 04 Feb 2022 01:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643966502; cv=none; d=google.com; s=arc-20160816; b=pZRD4mow7bwysA3Ch92nzGnpKECzn2KJvZ0jMr6DRmiDIodH+cdl2DnQOYN4fgzFyE nK02mwFEvpZCz4NYLgh1Os+upa/T4BDiyV02Z3CNJlI5GHs4qG3CH6QA38NITIC5t6I3 e9yJNITFDqs/qC6a/t8t2+TrBOQU+LfCrLVqX64GW4sxY3Ww9cHtlnbxSG92RxVm2V3S +Hhef5c1RPyFXHx/00FffhOfB74dJqJ0IcWW8wMvg2b55/iieA/h40npkSCyDu5T/8Wd TAcWMh95I0a+Mx0nXUxgMeOcTcxsLBGmNjnlFhEf9BRx+wqoO/BenhsgSmkXqoJHf9a3 9BYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Odwijx+uKepyk3NIvR5q7W0APreC/+JRwRuUWvXRhFA=; b=EV3J7ciRNyL1SM9Vv/ynMf1DFWMPKphIr4mhLGapIY31r5jSczi08EiwqFtUFhw/+5 Z3zoA5Ti0yIP7qapGeH/UNhJdPFZ5Etaq5AZxdzF4YIbV5Y5M4mcziC1NQEMTxM3YOO+ 7Ht+8YH/IAdW/HIXRJ3Sfkw89guTRq4xb68p6w0/WCEQWQ85UxOGZL0LOk5lG9UiUdnA v6DCU+LEi/F8yeM41WlTgo8KsTXuOgTBRPfrYkSTJoXyEmeV2YukzjtsgbS1of+Jytlj E84Q5cp6BBpA0ouesiJLRvcE8advBPV5i78kBcSYjb+dm7nXtaHFlrTv99N+TVDBjToC /k0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=PxhtkCXk; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20si1358014pfc.91.2022.02.04.01.21.31; Fri, 04 Feb 2022 01:21:42 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=PxhtkCXk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbiBCOBy (ORCPT + 99 others); Thu, 3 Feb 2022 09:01:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234042AbiBCOBx (ORCPT ); Thu, 3 Feb 2022 09:01:53 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ADF2C061714 for ; Thu, 3 Feb 2022 06:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Odwijx+uKepyk3NIvR5q7W0APreC/+JRwRuUWvXRhFA=; b=PxhtkCXk4Aa8m8wjxB18DGyPsi ZXwdCYIl74iDvMUxCKeL9VuCOJUZ8efn2MRPJAaOzguR1Hq1UsGTg/nbrsh4xghpTqehBbMkXPszS Hw7sVylgF3WjJoy/k+uisKD/bQr+N8+eFnX64ZMZIpF6QORUSsAovUYyUm7wY/2NoSpmAN0ksY7cw Dc0HHP4U6wjlgi/8MfX0/mY9Ss0Ra7oSEVv1iDtQMS02ujXz+4+tQmXiI3l5cxblZ+jKJImqS2uXY wt7Nx9H/710EW4iBtEE/4xHCCjuMjDLkOD1MIlWA4vptpiSV9TiYmiJ7PMztfa5YSBnWmtf1prlpz F8gUhT3g==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFcg4-001Vjb-Nr; Thu, 03 Feb 2022 14:01:36 +0000 Date: Thu, 3 Feb 2022 06:01:36 -0800 From: Christoph Hellwig To: John Hubbard Cc: Andrew Morton , Peter Xu , Jason Gunthorpe , David Hildenbrand , Lukas Bulwahn , Jan Kara , Claudio Imbrenda , "Kirill A . Shutemov" , Alex Williamson , Andrea Arcangeli , LKML , linux-mm@kvack.org, Jason Gunthorpe Subject: Re: [PATCH v3 4/4] mm/gup: remove get_user_pages_locked() Message-ID: References: <20220203093232.572380-1-jhubbard@nvidia.com> <20220203093232.572380-5-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220203093232.572380-5-jhubbard@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 03, 2022 at 01:32:32AM -0800, John Hubbard wrote: > There is only one caller of get_user_pages_locked(). The purpose of > get_user_pages_locked() is to allow for unlocking the mmap_lock when > reading a page from the disk during a page fault (hidden behind > VM_FAULT_RETRY). The idea is to reduce contention on the heavily-used > mmap_lock. (Thanks to Jan Kara for clearly pointing that out, and in > fact I've used some of his wording here.) > > However, it is unlikely for lookup_node() to take a page fault. With > that in mind, change over to calling get_user_pages_fast(). This > simplifies the code, runs a little faster in the expected case, and > allows removing get_user_pages_locked() entirely. Maybe split the lookup_node changes into a separate patch, as that allows to document that change even better.