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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13280C433DF for ; Wed, 24 Jun 2020 12:22:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CEFC120707 for ; Wed, 24 Jun 2020 12:22:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEFC120707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 799346B0003; Wed, 24 Jun 2020 08:22:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 74A066B0005; Wed, 24 Jun 2020 08:22:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 660046B0007; Wed, 24 Jun 2020 08:22:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 4DBA26B0003 for ; Wed, 24 Jun 2020 08:22:23 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BD3E3181AC9CB for ; Wed, 24 Jun 2020 12:22:22 +0000 (UTC) X-FDA: 76964018124.07.bulb80_1a164f126e44 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 82CE61803F9AB for ; Wed, 24 Jun 2020 12:22:22 +0000 (UTC) X-HE-Tag: bulb80_1a164f126e44 X-Filterd-Recvd-Size: 3877 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 12:22:21 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 162681F1; Wed, 24 Jun 2020 05:22:21 -0700 (PDT) Received: from [10.163.82.47] (unknown [10.163.82.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AEE133F6CF; Wed, 24 Jun 2020 05:22:17 -0700 (PDT) Subject: Re: [PATCH] arm64/hugetlb: Reserve CMA areas for gigantic pages on 16K and 64K configs To: Robin Murphy , kernel test robot , linux-mm@kvack.org Cc: Mark Rutland , Barry Song , kbuild-all@lists.01.org, Catalin Marinas , Andrew Morton , Will Deacon , linux-arm-kernel@lists.infradead.org, Mike Kravetz References: <1592893296-22040-1-git-send-email-anshuman.khandual@arm.com> <202006231703.DC6xDVaw%lkp@intel.com> <65df396e-1345-eb86-48cf-ee9bbd3881f4@arm.com> <63be846e-7e61-39f7-e3f3-9a61cb50e44c@arm.com> From: Anshuman Khandual Message-ID: Date: Wed, 24 Jun 2020 17:52:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <63be846e-7e61-39f7-e3f3-9a61cb50e44c@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: 82CE61803F9AB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable 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 06/24/2020 03:15 PM, Robin Murphy wrote: > On 2020-06-24 01:17, Anshuman Khandual wrote: >> >> >> On 06/23/2020 10:10 PM, Robin Murphy wrote: >>> On 2020-06-23 13:48, Anshuman Khandual wrote: >>>> >>>> On 06/23/2020 02:54 PM, kernel test robot wrote: >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 423=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 /* >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 424=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 * must be done after arm64_numa_init() which calls numa_init() = to >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 425=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 * initialize node_online_map that gets used in hugetlb_cma_rese= rve() >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 426=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 * while allocating required CMA size across online nodes. >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 427=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 */ >>>>> =C2=A0=C2=A0 > 428=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arm64_= hugetlb_cma_reserve(); >>>> >>>> Wrapping this call site with CONFIG_HUGETLB_PAGE solves the problem. >>> >>> ...although it might be nicer to include asm/hugetlb.h directly so th= at you can pick up the stub definition reliably. >> >> Including directly does not solve the problem and >> is no better. arm64_hugetlb_cma_reserve() needs >> protection wrt both CMA and HUGETLB_PAGE. Dropped HUGETLB_PAGE >> assuming it should have been taken care as the stub itself was in >> , which turns out to be not true. >=20 > Sure, I wasn't suggesting that the implementation of the header itself = wouldn't need tweaking - the point I was trying to get at is that it's pr= eferable to have *either* a stub definition in an always-reachable header= , *or* inline #ifdefs around the caller. Mixing both such that there are = 3 or 4 possible combinations just isn't nice to maintain. >=20 Makes sense, which one of these would be preferred instead. 1. Call site is protected with HUGETLB_PAGE and CMA 2. Definition is protected with CMA and HUGETLB_PAGE - in arch/arm64/mm/h= ugetlb.c 3. Declaration is in arch/arm64/include/asm/hugetlb.h (without any #ifdef= ) OR 1. Definition is protected with CMA and HUGETLB_PAGE - in arch/arm64/mm/h= ugetlb.c 2. Stub definition and declaration with #ifdefs (HUGETLB_PAGE and CMA) in= arch/arm64/mm/init.c 3. Call site is without any #ifdef