Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2818509pxb; Thu, 3 Feb 2022 15:27:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwavEXvvISprTqavym+ndYDpaor7sMpqAWSGXsX7SOiIAGWKZiiEH/5d4RE6D4x2zpUx9VX X-Received: by 2002:a17:907:2d2a:: with SMTP id gs42mr210042ejc.106.1643930863014; Thu, 03 Feb 2022 15:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643930863; cv=none; d=google.com; s=arc-20160816; b=EtAIJgoGY2puJdm7bsEqrVS7XkusjA8/bYLd7cvX9oHdPWFVVNWdHukYNpfftHs0dt 6oPKnusG07sfaMVRhwAjRsIS/go7dOLtAxi8rPv0/DDISUwqJyuTWgbjNHOCYRKfiMYO Ejget+vhdH0U15kjJ4ZGQzaZLiu6rXu1GTaQ/d839T6THcjfLGtyxxt5kuW30IhGQYsc XqAf6KXRDr5CI0gfa7V7JxX5AbH48ewKppDirTBqfzXgodd2ipH2KQdBSJ/uAlYDbSkm 1qe/9wamiqa9vh0zKgqILdeuqxausVPEvmcvGtON2CreLbAundZKP/4WfsgRkTFfJPl1 jlwg== 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=OgfpcxUM1YQT09LVbS6a5sMPyg+YT9z4Iq2cGwT7zuM=; b=SNOoPcHxjYCo+Djqhk7pI+NGClIGuGaWBgVCOYr/DkaD2QR8D1qONzl7XegltAVFg7 OjjNx1i11GdPsBs3MwofEpy2NFJZ8RPfDfSR1k4n43ZBmUWvsYBRx+2mcongO0yuHzXp gGw0wTEKSaJL+IpONfd1mMCN8HvwuLwYOy8YW+5nMTZHD4T2LjU4nMu9oYtgwKCliCwD Im0Y3FlwPw1Ejzf8xGfsH6qyYkabh0oKAna2j9G8HoPvlRdsvSDArlFQP/ttZ4jKE/4X wYS0/bszcntxNvDI0d8NSp0qTCzvSWW8eR0qJqk45UX30dPL56GUTS8OWByzH5U9zUC/ 98Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="S/aeUb5i"; 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 g9si136527edz.41.2022.02.03.15.27.17; Thu, 03 Feb 2022 15:27: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=@ziepe.ca header.s=google header.b="S/aeUb5i"; 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 S238104AbiBAMbj (ORCPT + 99 others); Tue, 1 Feb 2022 07:31:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237764AbiBAMbg (ORCPT ); Tue, 1 Feb 2022 07:31:36 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10853C06173B for ; Tue, 1 Feb 2022 04:31:36 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id bs32so3490578qkb.1 for ; Tue, 01 Feb 2022 04:31:36 -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=zheMQs8uAAxquEz6k+KgZ9BX+YfX7LejVHWsp9i7XpQcjLijqlaykECngIeKq8d9KG JQEH6d1W1dxFb8X5YGcXXUAilh2bRzzx4sVJ+OAn2fAqsCbWwM07oBFDpHoeEQin4G/v OxqJ524E8Jy3fFVWle3qWDAVHA3VgCT0Trx2aKogubHXFhRY03tqJWb0AiC/taIUyrLC Aje0XlM1+qPkMruRYBYKf2GtQCDQ9Xqkn7fn2XuMVSwtEpRhrQs/ihfo5vbBBZwXuw+9 +KyyxrEHI/o3iW5vnijvmkJBrRkJ8WJnRtBUSRhaZ0HJXxZmmrG0OLA2EOl6+dshRp+w nnKA== X-Gm-Message-State: AOAM530CAaHlJwbOSU5sS/CZ42WIv+1e/B7LFfP91I2W2++8luuz5tw2 DOoWBjNbN6Dqm+z4kf4A0uPxvw== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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