Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1642083imj; Thu, 14 Feb 2019 09:36:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmlOB6ldlKuBw16Y4Xsw2RpanCB25xeVLl9Mu41sXfSvrCEpXg+XfsizrDtCFh+iccVgWs X-Received: by 2002:a17:902:bcc2:: with SMTP id o2mr5196340pls.69.1550165770001; Thu, 14 Feb 2019 09:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550165769; cv=none; d=google.com; s=arc-20160816; b=Nvuv+eLL9hc+OaC/9vIaXVnvBEY8s7Unlnbl7Ggvdy5v13qWoF7cI5HvCdHrfj/m/0 4WsxTK/q5OM3hUu+12d5xA7sETuKq6zk9++mvLTLO/4kyp+Yh2mfIGJ+UY9oTuXLK0yQ T+k9mPkuARDaeXAy2CLXre5UEvQbJDat++RAk7EfxMAepyzqDX5YOxOM32FBepeQiLML iakbs7m00TadbVWuSXnRBrYR2YwuGzz8fofLHVb2NSQJkMMaC6UIa4UNG0i4q45KgBZB Oo2em6p6GK1ZY+4lI5dJlw+cwbxp0eQlvFbp1PlhFDRqz/TMAFqHQSuncMp7uD6lD6c2 Nh4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:to:subject; bh=qf8tV+OLTvvfDB6K9fe0Z04/CovSwO3s0qE34ZkDNQ4=; b=gNeMTWiP8eMbTIn07XoexQGz0tGkodMJ5rWatQ2lM2Q8zkr4Q2mQ41f9WFEYa4zISC sZ5Cu0UbUEZ9dHmfyKE010hRFw49Pjss7FdhMO3OOYjpSHcl+ijj5xtZ9IvcyUfcC5PC IGBX4l7PA820/ySvKYGmZuDGVSTVz6O1BSOVok17gYf6xVoOEoiaY7pOHPRxe3SYRi3y HpU0hx1CvK6DDaBqFfh1bcDB3hoMb+SQcED4kw9ppMH4XfzwJTzddC4Iwaw5R+fPZMA7 IA3U8+PG9UEvUHlIoPtFVi8LTuINqpuIOKNnIKBXJA/YpQr7qwhQEWOFpmTOV8H1GFOk 2Quw== 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 31si3129001pla.334.2019.02.14.09.35.52; Thu, 14 Feb 2019 09:36:09 -0800 (PST) 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 S2392704AbfBNJwK (ORCPT + 99 others); Thu, 14 Feb 2019 04:52:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:59322 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387579AbfBNJwK (ORCPT ); Thu, 14 Feb 2019 04:52:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2349EADF1; Thu, 14 Feb 2019 09:52:08 +0000 (UTC) Subject: Re: [PATCH v2] hugetlb: allow to free gigantic pages regardless of the configuration To: Dave Hansen , Alexandre Ghiti , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Martin Schwidefsky , Heiko Carstens , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Alexander Viro , Mike Kravetz , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20190213192610.17265-1-alex@ghiti.fr> From: Vlastimil Babka Openpgp: preference=signencrypt Message-ID: Date: Thu, 14 Feb 2019 10:52:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/13/19 8:30 PM, Dave Hansen wrote: >> -#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) >> +#ifdef CONFIG_COMPACTION_CORE >> static __init int gigantic_pages_init(void) >> { >> /* With compaction or CMA we can allocate gigantic pages at runtime */ >> diff --git a/fs/Kconfig b/fs/Kconfig >> index ac474a61be37..8fecd3ea5563 100644 >> --- a/fs/Kconfig >> +++ b/fs/Kconfig >> @@ -207,8 +207,9 @@ config HUGETLB_PAGE >> config MEMFD_CREATE >> def_bool TMPFS || HUGETLBFS >> >> -config ARCH_HAS_GIGANTIC_PAGE >> +config COMPACTION_CORE >> bool >> + default y if (MEMORY_ISOLATION && MIGRATION) || CMA > > This takes a hard dependency (#if) and turns it into a Kconfig *default* > that can be overridden. That seems like trouble. > > Shouldn't it be: > > config COMPACTION_CORE > def_bool y > depends on (MEMORY_ISOLATION && MIGRATION) || CMA Agreed. Also I noticed that it now depends on MIGRATION instead of COMPACTION. That intention is correct IMHO, but will fail to compile/link when both COMPACTION and CMA are disabled, and would need more changes in mm/internal.h and mm/compaction.c (possibly just replacing CMA in all "if defined CONFIG_COMPACTION || defined CONFIG_CMA" instances with COMPACTION_CORE, but there might be more problems, wanna try? :) Also, I realized that COMPACTION_CORE is a wrong name, sorry about that. What the config really provides is alloc_contig_range(), so it should be named either CONFIG_CMA_CORE (as it provides contiguous memory allocation, but not the related reservation and accounting), or something like CONFIG_CONTIG_ALLOC. I would also move it from fs/Kconfig to mm/Kconfig. Thanks!