From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5644C433EF for ; Thu, 3 Feb 2022 14:01:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 520D66B01A4; Thu, 3 Feb 2022 09:01:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AA3F6B01A8; Thu, 3 Feb 2022 09:01:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34A666B01A9; Thu, 3 Feb 2022 09:01:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 1D3216B01A4 for ; Thu, 3 Feb 2022 09:01:55 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CBA15824C43C for ; Thu, 3 Feb 2022 14:01:54 +0000 (UTC) X-FDA: 79101632148.21.17D2662 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP id 5A9F4A0011 for ; Thu, 3 Feb 2022 14:01:54 +0000 (UTC) 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 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 5A9F4A0011 X-Stat-Signature: dxkta4iyu4dhmpmorzoo5p1o166sfxum Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=PxhtkCXk; dmarc=none; spf=none (imf15.hostedemail.com: domain of BATV+84c482d3de8be5be3bd0+6738+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+84c482d3de8be5be3bd0+6738+infradead.org+hch@bombadil.srs.infradead.org X-Rspam-User: nil X-HE-Tag: 1643896914-827538 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.