Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1002082pxu; Wed, 2 Dec 2020 08:38:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5W6wC44AjLbequUIKeIJFkAN0jaA3z0NdsLNOKS7UD4Ii+LoDf+lmZMkGNH9EEjzapWgf X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr637135ejw.88.1606927091810; Wed, 02 Dec 2020 08:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606927091; cv=none; d=google.com; s=arc-20160816; b=kM0ux+88/AvLW/afi5EODSlI4mkp0ePRHIizc43aDP/+7byzs5+RHNmJNYfsnv70/t Z63I3oJLYl3+cwQ4rxXsXEgLdNLv7oPvmbfOXx1DTjhpzbubkZEYP+WSFT2QQwD6M1kj 3cI1QHssWOBRzb4TZiHE6plEyRL9iprGd+Np2EUfg6H8mNynZeLi5WBP6OMStpjTc3it GIVPmluUTYu5GHlnw6LP9WiT0Y8Rz4UXibuKi06B5am5IRbpTYNNJnd6HbtK2Rx72rHV r8P3z4+Gm9wl/n7HFGCxzD+9ktGg8BEfBreHNjkTfMObjdP71JoNrYjz+nZ71pLf5vZM DzNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=lWNnZqqVutLR2rhbvXfPKidHLkeMsgkq821cwWfjvXY=; b=Wmvb7LCQUcXGBdWzC/KXSG8swgn/mABBpstWMzvcU27+D5TcC5khTEFVjkRv3CO2qW VwMMP0u5QBpOqh+ue050ce2UD64yOytohxZbdfsZea+n4NH2XI0Xfh8vG0c+Dijk09t0 u0X/6JrtXZcaBg4HE4XPdfoJiZkJTodvGGcDtJUxry5bKLFP+NUMo+ANrnYxY3ZMuThJ 1C2z3KVt/7S9aXbJcfnLGOAMNY4UuORysF8m27jRezM2MFg4ggwlrG+FeryritmU9qgm +GZAbo32kN6M0eIi23mdHmefm1nCi0w/W3o/7Beq3T8mCwJatapP1Ctp+HqqipE0Msp2 UeLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 2si255242ejb.712.2020.12.02.08.37.47; Wed, 02 Dec 2020 08:38:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730775AbgLBQeJ (ORCPT + 99 others); Wed, 2 Dec 2020 11:34:09 -0500 Received: from mga11.intel.com ([192.55.52.93]:33932 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbgLBQeJ (ORCPT ); Wed, 2 Dec 2020 11:34:09 -0500 IronPort-SDR: KeEHZnNoh/yb6/tkTFY3Zs4+5DmH3TfVwhx/5X22TOn0HYm7+HYdb7WwS0FXojRDTPTiOUsggy gBWl4raUlR4g== X-IronPort-AV: E=McAfee;i="6000,8403,9823"; a="169540552" X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="169540552" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 08:33:13 -0800 IronPort-SDR: IsQaCy7/TP2wDXxgVxMAm1dLhX9b8aILkII+0MesCurV60o/kVoLolc4Nq6zglBhMjM/Gw6MDv AE9HOwgYQzXg== X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="481617321" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 08:33:12 -0800 Date: Wed, 2 Dec 2020 08:33:12 -0800 From: Ira Weiny To: Pavel Tatashin Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, david@redhat.com, osalvador@suse.de, dan.j.williams@intel.com, sashal@kernel.org, tyhicks@linux.microsoft.com, iamjoonsoo.kim@lge.com, mike.kravetz@oracle.com, rostedt@goodmis.org, mingo@redhat.com, jgg@ziepe.ca, peterz@infradead.org, mgorman@suse.de, willy@infradead.org, rientjes@google.com, jhubbard@nvidia.com Subject: Re: [PATCH 3/6] mm/gup: make __gup_longterm_locked common Message-ID: <20201202163312.GU1161629@iweiny-DESK2.sc.intel.com> References: <20201202052330.474592-1-pasha.tatashin@soleen.com> <20201202052330.474592-4-pasha.tatashin@soleen.com> <20201202163145.GT1161629@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202163145.GT1161629@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 08:31:45AM -0800, 'Ira Weiny' wrote: > On Wed, Dec 02, 2020 at 12:23:27AM -0500, Pavel Tatashin wrote: > > __gup_longterm_locked() has CMA || FS_DAX version and a common stub > > version. In the preparation of prohibiting longterm pinning of pages from > > movable zone make the CMA || FS_DAX version common, and delete the stub > > version. > > > > Signed-off-by: Pavel Tatashin > > --- > > mm/gup.c | 13 ------------- > > 1 file changed, 13 deletions(-) > > > > diff --git a/mm/gup.c b/mm/gup.c > > index 3a76c005a3e2..0e2de888a8b0 100644 > > --- a/mm/gup.c > > +++ b/mm/gup.c > > @@ -1567,7 +1567,6 @@ struct page *get_dump_page(unsigned long addr) > > } > > #endif /* CONFIG_ELF_CORE */ > > > > -#if defined(CONFIG_FS_DAX) || defined (CONFIG_CMA) > > #ifdef CONFIG_FS_DAX > > static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages) > > { > > @@ -1757,18 +1756,6 @@ static long __gup_longterm_locked(struct mm_struct *mm, > > kfree(vmas_tmp); > > return rc; > > } > > Isn't this going to potentially allocate vmas_tmp only to not need it when > !FS_DAX and !CMA? To clarify, when FOLL_LONGTERM is set... IRa > > Ira > > > -#else /* !CONFIG_FS_DAX && !CONFIG_CMA */ > > -static __always_inline long __gup_longterm_locked(struct mm_struct *mm, > > - unsigned long start, > > - unsigned long nr_pages, > > - struct page **pages, > > - struct vm_area_struct **vmas, > > - unsigned int flags) > > -{ > > - return __get_user_pages_locked(mm, start, nr_pages, pages, vmas, > > - NULL, flags); > > -} > > -#endif /* CONFIG_FS_DAX || CONFIG_CMA */ > > > > static bool is_valid_gup_flags(unsigned int gup_flags) > > { > > -- > > 2.25.1 > > > > >