Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1568705pxb; Fri, 6 Nov 2020 13:11:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoIFeCjvGjMenNWeSsh7bHdT+lUOnwvloZPmRSUABWbdYh80KMKRwdAtYn5tzoVv0qFi/v X-Received: by 2002:a17:906:b783:: with SMTP id dt3mr3981805ejb.534.1604697078413; Fri, 06 Nov 2020 13:11:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604697078; cv=none; d=google.com; s=arc-20160816; b=B2Di6zMhQiO4WfrHYlSmuKAWY4DPsXy1DvUPwex80uGZkNaY5drviNI7r27p9j4Jyy Ydcmh2bx8zskAJFlkARqsRmvdKCfPDeIh9JvuKAc9UlJ2dBjki2T4q562GiSnmYt7oIT 5YQiQDvBkS5Ws+5t3uqUnhjyt9DKzFqv8jaYRwi5AHQEk9Z8IzNglLp9Ir+gvWxIinFY 0nzAXuDph+kCcmyxfd0T3gR/iiQRtaKBZ/rK2K+4R71acNjU9UW/N6wxubh8oZUqtPN6 KOasTWfY/RuEnGA+h0LghGsFhYd3W/mSAbvQy7AAWbaaekzO7pbwfLgGsPygku12EtK3 Cbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=9yPdLjLMk4VDQyCtkT8t7GZNpDCZAji0utGt1xU6RII=; b=soufp/32yPFvMdOYpB8mqU0YR/ZeU7dLMzDbEVi2hLOvs4MjOqS27deskS497XverL e2HSX6ICcZKhsmU6aBdEs8EpkC8hGYlVz2Fyx24OABF3u/NbX4heCZo+/yVwMj+xztwd Ae4zYdA1LzFmCODZuGxssDDiqOpq0QgVqYP3DIWkn1JCCXIjOicpQ7e/vmTJElxxrxJJ L4rgtPmP9RPJzglTXbRV5uvF25E6+LXs3rKtL0qI0+QFQJp2kP12HvWII4RC1AH4x8xa X6Q6Xxin808FYryPXorUP/x9fqYI3bCIrUURIdqlGbElHlQReXmwRj++C1xmzsazAyJg /Qhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="FulphIc/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si1570714eju.136.2020.11.06.13.10.52; Fri, 06 Nov 2020 13:11:18 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b="FulphIc/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728517AbgKFVJd (ORCPT + 99 others); Fri, 6 Nov 2020 16:09:33 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:11447 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728408AbgKFVJc (ORCPT ); Fri, 6 Nov 2020 16:09:32 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 06 Nov 2020 13:09:30 -0800 Received: from rcampbell-dev.nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Nov 2020 21:09:27 +0000 Subject: Re: [PATCH v3 4/6] mm/thp: add THP allocation helper To: Christoph Hellwig CC: , , , Jerome Glisse , "John Hubbard" , Alistair Popple , "Jason Gunthorpe" , Bharata B Rao , Zi Yan , "Kirill A . Shutemov" , Yang Shi , Ben Skeggs , Shuah Khan , Andrew Morton References: <20201106005147.20113-1-rcampbell@nvidia.com> <20201106005147.20113-5-rcampbell@nvidia.com> <20201106080147.GD31341@lst.de> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <7cac5437-c5b1-25e2-f98a-c0a6c9af7ac6@nvidia.com> Date: Fri, 6 Nov 2020 13:09:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20201106080147.GD31341@lst.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604696970; bh=9yPdLjLMk4VDQyCtkT8t7GZNpDCZAji0utGt1xU6RII=; h=Subject:To:CC:References:X-Nvconfidentiality:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=FulphIc/so5+6aTPESZcFxW8h9OUZ2iyqmutRPbl18GBVLgAyX6fz4lJiev0O1YP6 q/LNpjbRlW3SKWvukveekDhx0gjNTyauAUv90vIV2i9n949F8fptDvzdatTN74Gl7/ f/PC1ihNAUIC/qOVlVty9n9Gv7EjknTWE+2q/GosGmlHMzqzSzMcN6nR1s0OIgCca4 6FVZ7++xm6YWl9ul+2YLkZMvUsD6rl4gbVZX0+FR9xXlYHr9pjH9J0BMXIsVl3xfcX BMkE3aZvmR0guP2wjHWUqdDJJ5GlhtqIrC+NpmZfIIYGBbHGCrNbb22hcdjF6jg8XS Yq5UDWS1nzT6A== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/6/20 12:01 AM, Christoph Hellwig wrote: >> +#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? Same problem as with prep_transhuge_device_private_page(), since alloc_hugepage_direct_gfpmask() and alloc_hugepage_vma() are not EXPORT_SYMBOL_GPL. >> +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. Sure, I'll do that for v4.