Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2230209pxj; Sun, 9 May 2021 20:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9QLNXreXwA/BZCHjdf8reA6wjXDwMgNP9tNqKQ6ZyzUUKElqlAzfkTG80TKq73qWdp2m1 X-Received: by 2002:a05:6638:b14:: with SMTP id a20mr19584704jab.132.1620615975984; Sun, 09 May 2021 20:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620615975; cv=none; d=google.com; s=arc-20160816; b=DUZSeen8Ibfpf/nbo8fI/WPIEooW5P/yzb+amWcXwZL611sBZGUip+xvkldlylNFnM Sv9MYJTeKTH7Il5Lilx+juauQkrJficipznLnVuCMzRTKINEAaKU7eURowxVxZt6BZL1 PtrwJOcCSYO0ddikZr4zWhrXA2/JHZfkVrQBg30LCxaLFgKjIVfcrzisyj3WCsqKwac3 8HfO8hL+aZlpcY1WXte9f2GnbhjJwGRpYXGZ7fAO4VVzpR6VInPxmIvlnySs+qZQ/75Q fQ+mw99akypdfj3RGB5yENW/IVixEuHWMP19yphmSPIa2oB83HiNqr8e9jqqe/QJ3uv+ dlEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BA9668HKYYv/ZfHQYvSqaMfgafLjye+7vnvy7Bq3uRE=; b=OqhO34Fjsm3jhsKoYZtUXaTC3oM0Fgwv9Bh9NFhpgomazOkBgH/ciDLErUoXMNhx0E NfdwuTFE6YcZQLZNyoog6xsPoNqu+p5j5LRg1GP6I99S+ixy6aVpN5sbvOfLmuRFSW3f svb99QfXq9ewDBMA/XPVcfh5/vw+Jwqcb42APRSTmL/VL5Mydrm7PLXFGVXmnQPyQqrC YHByvE8O5Sw0hNOm4LHPFnLbtsN2H3ZWCnrGBuEd5rlzRJO95JVzqpKlDWXlx5jwzGju jWAX/JQRTjI/VCgLblLeJNebdE3yf7BF5NPKQItWSvvDHAs4moCYKjvatt8lZZQ7nKCz rVVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=060tWM4S; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si16358201iov.91.2021.05.09.20.06.04; Sun, 09 May 2021 20:06:15 -0700 (PDT) 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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=060tWM4S; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbhEJDF6 (ORCPT + 99 others); Sun, 9 May 2021 23:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbhEJDFz (ORCPT ); Sun, 9 May 2021 23:05:55 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3041C061574 for ; Sun, 9 May 2021 20:04:50 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id a11so8418816plh.3 for ; Sun, 09 May 2021 20:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BA9668HKYYv/ZfHQYvSqaMfgafLjye+7vnvy7Bq3uRE=; b=060tWM4SknVVj4PmMYSQ2IxObhiNmRqo7ozdaznfhk5TRXMe+OlBoY7QnoM4gImwsq vWlOaoTlZ3hnlngqYG4L9EL/7ZKL/dYFU7PteKGHeH7K9IjzKhDWbkejlSLwViZdcAoC YdaLNuDuToJGC4xCduGOEuRuKDPzeo21WdQLqV5Wscuhmit9WYmZq+nD9wP/gAFpc/pb oxYK6qhkVaEvINiJLaVqx5cUB68Cl/bDlX85OgJkXi0luSpbJs+XcdAGMgM+LjbjjaK4 aqS+O70GkVyIf2sJfVnylcJ6j3aaT0eDHvZVziaBP5vsO/7NrlP+3FJtaRhnbF4gfwPT lu5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BA9668HKYYv/ZfHQYvSqaMfgafLjye+7vnvy7Bq3uRE=; b=egaHfbeDIhTLiPkDzKtrERnWkGcPgi8+QjmcZMM3hmXMEJEmm0sVqZF3IbLKz7FzcG pR/hOifLL6cHB6UC0oPcTHUkSFrkjVI1V7ZLuXK4BehEokZ5k1dTikCPByBtAn9/VTqg voFMWe0YzBRRitLYadjdGX2Sm3WuumDl8OFkfyGa9Xn5YbTob5Lwd4iyXmr5BFl6kO3R H2eB0G4vgdZokjAoAWhG6D4rn+8Ru9lKl27fYiW9IG2Ixow+TMY4E2eP2+RGbYrAKVKb ubU4TAsd95qT9Ftrit3bQfzFL1bS6sJnmQu2Ebf4xPoqcmMN4Mt8fbhC/nY7FANo/1/D R31A== X-Gm-Message-State: AOAM531HC+qz52AqvX+JX7fQ8QkYOXMBXGlzoLrIPg6e0OB30i5c8TG+ 6bIvJHaW1PfYDuqxaUw4+1WtCw== X-Received: by 2002:a17:902:b28b:b029:ed:19aa:5dec with SMTP id u11-20020a170902b28bb02900ed19aa5decmr22866273plr.78.1620615890445; Sun, 09 May 2021 20:04:50 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.236]) by smtp.gmail.com with ESMTPSA id a128sm9777003pfd.115.2021.05.09.20.04.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 May 2021 20:04:50 -0700 (PDT) From: Muchun Song To: corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com, willy@infradead.org, osalvador@suse.de, mhocko@suse.com, song.bao.hua@hisilicon.com, david@redhat.com, naoya.horiguchi@nec.com, joao.m.martins@oracle.com Cc: duanxiongchun@bytedance.com, fam.zheng@bytedance.com, zhengqi.arch@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Muchun Song Subject: [PATCH v23 8/9] mm: memory_hotplug: disable memmap_on_memory when hugetlb_free_vmemmap enabled Date: Mon, 10 May 2021 11:00:26 +0800 Message-Id: <20210510030027.56044-9-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210510030027.56044-1-songmuchun@bytedance.com> References: <20210510030027.56044-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The parameter of memory_hotplug.memmap_on_memory is not compatible with hugetlb_free_vmemmap. So disable it when hugetlb_free_vmemmap is enabled. Signed-off-by: Muchun Song Acked-by: Mike Kravetz --- Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++ drivers/acpi/acpi_memhotplug.c | 1 + mm/memory_hotplug.c | 1 + 3 files changed, 10 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 3cc19cb78b85..8181345e996a 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1638,6 +1638,10 @@ on: enable the feature off: disable the feature + This is not compatible with memory_hotplug.memmap_on_memory. + If both parameters are enabled, hugetlb_free_vmemmap takes + precedence over memory_hotplug.memmap_on_memory. + hung_task_panic= [KNL] Should the hung task detector generate panics. Format: 0 | 1 @@ -2904,6 +2908,10 @@ Note that even when enabled, there are a few cases where the feature is not effective. + This is not compatible with hugetlb_free_vmemmap. If + both parameters are enabled, hugetlb_free_vmemmap takes + precedence over memory_hotplug.memmap_on_memory. + memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest Format: default : 0 diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 8cc195c4c861..0d7f595ee441 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "internal.h" diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 16b3a7a1db8c..6512e6f641bb 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1052,6 +1052,7 @@ bool mhp_supports_memmap_on_memory(unsigned long size) * populate a single PMD. */ return memmap_on_memory && + !is_hugetlb_free_vmemmap_enabled() && IS_ENABLED(CONFIG_MHP_MEMMAP_ON_MEMORY) && size == memory_block_size_bytes() && IS_ALIGNED(vmemmap_size, PMD_SIZE) && -- 2.11.0