Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5289362img; Wed, 27 Mar 2019 05:56:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG5gN/ga4oxS6XF2ELOGGOtnaizjH7WO9t075TCwXzUSacQKFkrs1WLwsPUDXx5djHp9y2 X-Received: by 2002:a62:1c4:: with SMTP id 187mr34950611pfb.256.1553691414778; Wed, 27 Mar 2019 05:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553691414; cv=none; d=google.com; s=arc-20160816; b=MmVFp2XVjobAH7/0Kn2zMfpxyA0DY9wljdGaUb0LPKai9MNv0ognSOVlwdiex7oa0W 1OzceYp88h/dobylv6W+1SrwMt+fcUH3seB6KAxGkL4tCbflWwzQgcxUWG0oC1Pbnei+ GFeFtb6egtutCM70rDkPHKg6pLNL2ganl8MMXimORlMDkfwSk3sxMNaP6k0r/9GxJqgf uMmsFnsqXBAVqNBsEc7+7O8h0ssqkQp7JRoMMqQRgL4b+x80HKvIPtaOvTC1EIasUGlE j/GFocgnC90xjnMmaiHdsSmL6EeCSskhB+0ohHwysdWeUEwcXJCHy1TfFNbY4w+kYecG fuVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=QsOSkhv74cDKO5ywshCd8pRvl6x6lREXhAvQlgsVksI=; b=Cv6bwlqTwEF8U7d0d8P2hCi2+IlcGb9kzGuNIsPKen7Ag8tkRmgXdrzookP8a4KqPg Qvad0+m5GDQfq94XeaBElR+UHdDaFUFNUXmVN6bEzsvvioRnXfBJCvQ0Mrh2gnUgh+AO 7cI6mxBqtZjdTaysxE+znW1+GN+DFNqo9AkTVKFhhqiuBaWYng5OXL4nNWsrH4AA17TC e6seaAWJv4uIBlZ/UmSX1D2NmydhQQKKGOoc8+WOa9MIq1B4XrYWi/WgMONU2QWE5eF6 1D8YKrMgYVpebx1fIsi/tkmnP3GqH0tmMxfvji8+aBn18WGpNyRZDrsiFuLC3F8irrxY lcqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si18953524plp.217.2019.03.27.05.56.39; Wed, 27 Mar 2019 05:56:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729392AbfC0Myo (ORCPT + 99 others); Wed, 27 Mar 2019 08:54:44 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:35867 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbfC0Myn (ORCPT ); Wed, 27 Mar 2019 08:54:43 -0400 Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 4CC6A20000A; Wed, 27 Mar 2019 12:54:35 +0000 (UTC) Subject: Re: [PATCH v8 4/4] hugetlb: allow to free gigantic pages regardless of the configuration To: "Aneesh Kumar K.V" , mpe@ellerman.id.au, Andrew Morton , Vlastimil Babka , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Mike Kravetz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org References: <20190327063626.18421-1-alex@ghiti.fr> <20190327063626.18421-5-alex@ghiti.fr> <87pnqcws2u.fsf@linux.ibm.com> From: Alexandre Ghiti Message-ID: <95819dc9-7910-f273-681c-a241fee62dd2@ghiti.fr> Date: Wed, 27 Mar 2019 13:54:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <87pnqcws2u.fsf@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/27/2019 11:05 AM, Aneesh Kumar K.V wrote: > Alexandre Ghiti writes: > >> On 03/27/2019 09:55 AM, Aneesh Kumar K.V wrote: >>> On 3/27/19 2:14 PM, Alexandre Ghiti wrote: >>>> >>>> On 03/27/2019 08:01 AM, Aneesh Kumar K.V wrote: >>>>> On 3/27/19 12:06 PM, Alexandre Ghiti wrote: > ..... > >>> This is now >>> #define __HAVE_ARCH_GIGANTIC_PAGE_RUNTIME_SUPPORTED >>> static inline bool gigantic_page_runtime_supported(void) >>> { >>> if (firmware_has_feature(FW_FEATURE_LPAR) && !radix_enabled()) >>>         return false; >>> >>>     return true; >>> } >>> >>> >>> I am wondering whether it should be >>> >>> #define __HAVE_ARCH_GIGANTIC_PAGE_RUNTIME_SUPPORTED >>> static inline bool gigantic_page_runtime_supported(void) >>> { >>> >>>    if (!IS_ENABLED(CONFIG_CONTIG_ALLOC)) >>>         return false; >> I don't think this test should happen here, CONFIG_CONTIG_ALLOC only allows >> to allocate gigantic pages, doing that check here would prevent powerpc >> to free boottime gigantic pages when not a guest. Note that this check >> is actually done in set_max_huge_pages. >> >> >>> if (firmware_has_feature(FW_FEATURE_LPAR) && !radix_enabled()) >>>         return false; >> Maybe I did not understand this check: I understood that, in the case >> the system >> is virtualized, we do not want it to hand back gigantic pages. Does this >> check >> test if the system is currently being virtualized ? >> If yes, I think the patch is correct: it prevents freeing gigantic pages >> when the system >> is virtualized but allows a 'normal' system to free gigantic pages. >> >> > Ok double checked the patch applying the the tree. I got confused by the > removal of that #ifdef. So we now disallow the runtime free by checking > for gigantic_page_runtime_supported() in __nr_hugepages_store_common. > Now if we allow and if CONFIG_CONTIG_ALLOC is disabled, we still should > allow to free the boot time allocated pages back to buddy. > > The patch looks good. You can add for the series > > Reviewed-by: Aneesh Kumar K.V > > -aneesh > Thanks for your time Aneesh, Alex