Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1087888pxb; Fri, 6 Nov 2020 00:03:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/edK0jh3Cb9Dd409IUcqiBm6gecDUkYCwvMDVg89OLD6DGJ+PFo+r6im8zPY+ANCzNEZI X-Received: by 2002:a17:906:6949:: with SMTP id c9mr885078ejs.482.1604649822272; Fri, 06 Nov 2020 00:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604649822; cv=none; d=google.com; s=arc-20160816; b=f/Sea1NiEOZoukyA/1DfLUjy62inycjEEbjWIm5ybHoZb/GOQeIS8ylfEHI/59lc5A fEWwvbsZp7OYwotH02tyZndorFTyusoPVE5bTxmirnGZL6PAcrsIhvkndUTHLx+hzCoo csP5+Uh0/p8UiRMUgz3a6a4c11guMUZ0AoM8pt+LYs9/sQ8vrnJN2zFbyU2XjhscbT03 YWO9DjGP8LR3QPzmzz6ORd4SgUqZlXTXnkYXb8PzF3v+oV0U5yWwlv/r/PI8+WW/zyFe reYxDSPKXsOPfQXg9XguyATvF97hHLtDobiq2LQgq8zVhoUSwm0iBYheThKzhYipgc9r Tbdw== 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; bh=rqCD/rQLUFzifVrKyLv/Mvjr/XY3TLZ9/x2rQvmotAQ=; b=g0qzH6vaVXCWpu7lNLmvC+wmKCkQtysVvb0f4p14DSXHPq0JN//48X/i33LHnUbnwC fD91viJlOL1sQkRQvYN8GE0sGipD10V5150IZBAI0pto7Ri99FRbNYADykzxRMpcglyE kNUyTmBFae7RnGponmY6iXgVEfLbxUhBQjvMoRATs4jAAPGlHNBg6fkeSEdEltfL8VWd LpbvHZBqjzYSAJrXApXPnX9n7hztFh9400q4LnGJuflnaLlqh27YZMxkknLR7pqeG0DT VM8qlLqIa+2scYPBsF2ng7nkLjvtJYppPIVFury+WrBb5xGCKaJdJu8Gko9zVw8PAuQm +tqg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz19si378515ejb.699.2020.11.06.00.03.19; Fri, 06 Nov 2020 00:03:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726514AbgKFIBw (ORCPT + 99 others); Fri, 6 Nov 2020 03:01:52 -0500 Received: from verein.lst.de ([213.95.11.211]:50484 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgKFIBv (ORCPT ); Fri, 6 Nov 2020 03:01:51 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id A9C9068B05; Fri, 6 Nov 2020 09:01:47 +0100 (CET) Date: Fri, 6 Nov 2020 09:01:47 +0100 From: Christoph Hellwig To: Ralph Campbell Cc: linux-mm@kvack.org, nouveau@lists.freedesktop.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Glisse , John Hubbard , Alistair Popple , Christoph Hellwig , Jason Gunthorpe , Bharata B Rao , Zi Yan , "Kirill A . Shutemov" , Yang Shi , Ben Skeggs , Shuah Khan , Andrew Morton Subject: Re: [PATCH v3 4/6] mm/thp: add THP allocation helper Message-ID: <20201106080147.GD31341@lst.de> References: <20201106005147.20113-1-rcampbell@nvidia.com> <20201106005147.20113-5-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201106005147.20113-5-rcampbell@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > +extern struct page *alloc_transhugepage(struct vm_area_struct *vma, > + unsigned long addr); No need for the extern. And also here: do we actually need the stub, or can the caller make sure (using IS_ENABLED and similar) that the compiler knows the code is dead? > +struct page *alloc_transhugepage(struct vm_area_struct *vma, > + unsigned long haddr) > +{ > + gfp_t gfp; > + struct page *page; > + > + gfp = alloc_hugepage_direct_gfpmask(vma); > + page = alloc_hugepage_vma(gfp, vma, haddr, HPAGE_PMD_ORDER); > + if (page) > + prep_transhuge_page(page); > + return page; I think do_huge_pmd_anonymous_page should be switched to use this helper as well.