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 4C4F6C433F5 for ; Tue, 1 Feb 2022 12:31:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB1308D0066; Tue, 1 Feb 2022 07:31:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C61E68D0054; Tue, 1 Feb 2022 07:31:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADADC8D0066; Tue, 1 Feb 2022 07:31:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9B1618D0054 for ; Tue, 1 Feb 2022 07:31:36 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5BC93181CA760 for ; Tue, 1 Feb 2022 12:31:36 +0000 (UTC) X-FDA: 79094146992.26.A7C0F69 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by imf04.hostedemail.com (Postfix) with ESMTP id F0D8840007 for ; Tue, 1 Feb 2022 12:31:35 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id 71so14886378qkf.4 for ; Tue, 01 Feb 2022 04:31:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OgfpcxUM1YQT09LVbS6a5sMPyg+YT9z4Iq2cGwT7zuM=; b=S/aeUb5iNCgJN76OvNhe3noC+RNK2w/xXMmNls7LjaGBxxlN/pM10ooLAFACwJiHVc bN9+t4cX5cPCa4KOPHTe07h9xg3c+/8MdWaDYpVhdlgP+J6N8KOTv+tO516q2l7sS5Ns kTG5P4ojPkmQ4WW37GQfh2FA5KLd7SrbrvfbuwY/JCkZr62woyRKBe+a58LLHlyqAYP5 9dRtYSyACwe31w+CilxbUQDSRs/k7ziXEvSyFwYXCbj9sVTw70AwQbyRoYygKZyTnvjr QtcPnXGw389H4XqgEBF8rYeBdL+6Rop40n4b8/+1UuS7BJrhQE0j8avYnBF+xcaV32zk dnmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OgfpcxUM1YQT09LVbS6a5sMPyg+YT9z4Iq2cGwT7zuM=; b=u9/N5WqrKgjYxNpVIhoW1fOsXOkH4iiRhjPCB/FIlX9nRfHrQKTSvmoeHiNX5ozRgp 9fsoRzzcWV6dxuezww+fFxLCzZBPx8GBRayfaSyoymWjEU7P0uzP2r9lLHKhv/vcoOtc 124uMXWZI8XRMSOPxrOq9wY1WlTBpn2+Id7pJ/yAV2zwQI9FegckIT/2STNTPVIWbeNw XGFrg0vxS+IeimV0rYbdnLzXWub8p5h58cbT64ioj9PoQHL8fWUA2Y6kXN5oZyOak8Ya 5usc42rIpylRjOfnw7ZaoBto5LVQOvvavBaMmP6HFPZovIO6648ngNxpzD3MsX2VfWLT 3ssg== X-Gm-Message-State: AOAM532zEcKqQIctt070QfhQI4uTZRI/HttuNzmObib1S1Oas/5H2d2j CF9XLVxCNNEIeXx7xX0IRVG3Gg== X-Google-Smtp-Source: ABdhPJzmGuAiQPbbwfPi5nKhZGAKkWjgngLA/JAnb2Y9o8GB4Pxo98NrM1I0j9QIlsco0XcLKaaLog== X-Received: by 2002:ae9:eb4f:: with SMTP id b76mr15968552qkg.696.1643718695219; Tue, 01 Feb 2022 04:31:35 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id q15sm9597818qti.41.2022.02.01.04.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 04:31:34 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1nEsJq-00A6xN-2N; Tue, 01 Feb 2022 08:31:34 -0400 Date: Tue, 1 Feb 2022 08:31:34 -0400 From: Jason Gunthorpe To: John Hubbard Cc: Andrew Morton , Peter Xu , David Hildenbrand , Jan Kara , Claudio Imbrenda , "Kirill A . Shutemov" , Alex Williamson , Andrea Arcangeli , LKML , linux-mm@kvack.org Subject: Re: [PATCH v2 4/4] mm/gup: remove get_user_pages_locked() Message-ID: <20220201123134.GZ8034@ziepe.ca> References: <20220201101108.306062-1-jhubbard@nvidia.com> <20220201101108.306062-5-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220201101108.306062-5-jhubbard@nvidia.com> X-Stat-Signature: wngaxscgprhsdqfjeez1gou4t9scdkkd X-Rspam-User: nil Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b="S/aeUb5i"; spf=pass (imf04.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.222.181 as permitted sender) smtp.mailfrom=jgg@ziepe.ca; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: F0D8840007 X-HE-Tag: 1643718695-32280 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 Tue, Feb 01, 2022 at 02:11:08AM -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. > > Cc: Jan Kara > Suggested-by: Jason Gunthorpe > Signed-off-by: John Hubbard > --- > include/linux/mm.h | 2 -- > mm/gup.c | 59 ---------------------------------------------- > mm/mempolicy.c | 21 +++++++---------- > 3 files changed, 9 insertions(+), 73 deletions(-) Reviewed-by: Jason Gunthorpe Jason