Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2663388pxy; Sun, 25 Apr 2021 00:16:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8tYt1g+lDjFsuQ0uGvr4wqFCA8gHUY9mjWlYW9dsxmVvzLv59pyROw7w4pqfIs5J3HGj4 X-Received: by 2002:a62:188:0:b029:259:e9c9:4758 with SMTP id 130-20020a6201880000b0290259e9c94758mr11631923pfb.68.1619335005519; Sun, 25 Apr 2021 00:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619335005; cv=none; d=google.com; s=arc-20160816; b=a7zbsathHv0n2hn4nS1adhRbs+sOy98+b4vt5WFHwOJCpQwEJ5+vU6OPPpMcV6e9QZ 7lsrXGA13+HPo5kk+6D5ydK2D2wqYNHuUnqAwpSw6QUOO1roz11Jfn4TycQAST5eMLOn 6vs4L51UPQUdb1FYx4SrrDsx+PghFLhZCqdrFP++H57Qu4tx9j2No9QaQ5xfPlWKS0K5 H53Aywg+PnRZqC1anOGdg+wkfDywBC2BDgr9e+/Fy6u9a5SV2gCnaX3Mygp9JUs4mIx8 Ct9aowLwtQnuGuJTVUaKRHYXN0EZyRZMAWcg1cB/ujDtI/UVuo7PRN2+aNVRJwc7+0sB bVwQ== 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=5NQIABLEewgKDhqj4Cu1k3a4cKl/gjUQHTrPXMY+Vi4=; b=jxB+7K+OwJjniO0SRSn6T0PrSFZC2ro19vsinmfU5Wejk48ZOqi4d41GQdtiBorVDX 2eoDv1Yhj9QTxIZHJ6bObiimaG0hhDFjwANlsSKT4b4yH1qGtb4Fos+AYG+tzy3ydqd7 3RnsgUSiQorSBojQ40rezMDgR2HywNcBADdRim1HIjyo0EiAjqstRFeDxPFh74hWZjvz /EdQhG9q66+7D06HgFV2B56AK3hzswdF16T/SAm/Vi2Vo0ZyrFT4JTLNt0HC7JY8RDLL kZrr1z36lDZwt+O8YekNfV4ATH/zVYVViWJNyR8pPSFHoauXXHc+K+Vf4SSYgM4a5UoH 8k9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=GxvFqSmI; 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 s2si706375pfe.218.2021.04.25.00.16.33; Sun, 25 Apr 2021 00:16:45 -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=GxvFqSmI; 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 S230159AbhDYHPC (ORCPT + 99 others); Sun, 25 Apr 2021 03:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbhDYHO7 (ORCPT ); Sun, 25 Apr 2021 03:14:59 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAD38C061574 for ; Sun, 25 Apr 2021 00:14:19 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id g16so10437137plq.3 for ; Sun, 25 Apr 2021 00:14:19 -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=5NQIABLEewgKDhqj4Cu1k3a4cKl/gjUQHTrPXMY+Vi4=; b=GxvFqSmI12PysPlkqX9s9D8TUgHjcgxPY7fSr/k4LNdP1t71GBs3e+PITWKN4a+WA5 SeQj8jvWslXnqjm5k3P/0EVHOspU7fFjLovUDgQd+0QfWVYz7jDY9ySwl5Nptp++kTvf BU3lTaUnM5FB4Mye2tFZR53oPO6dalXK2MwBaXzbaEYrtLJNvvL/eTPZwmOnJ2IQZ6sw zaVw5kIDVKfs90RLD8/b8nlVFeEuyxk14m8VH0kchH26tRzwjUEL/Q3BucRlvCv7FTL8 75KU5PXve4PFYvcOEX00M2WdEy0G7GN2Aw1d0rhwvIDV57AwbihAm2sF6d5T8rVzjn0v GbfQ== 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=5NQIABLEewgKDhqj4Cu1k3a4cKl/gjUQHTrPXMY+Vi4=; b=MT5mhi6EY1K/dvK6Zn7/FP0UmZnn7cRt44t3/qE5CZVwNXQx13S9ONIZOFRItKCuEI pmIdX3+VzMGQj6Tcf1cLkRl3FVMGbinleOSbaEh+pRHLCj/ESPvuWZFK1PAwCyZ/+RA9 gP9sy3qhIJPplDDGL5dXiGVsyKoXxOxfjYie2e3kx8/bc6qs3sp0DMfM3bdWgiNrwW+T EKBkRAOmjGSYu+WnYCB5Dz+uwQZNsYxP+KOVO2IDxgsbzVMyrskB4qjvMD9JYeSqlXZX 09IKPTN24uG+dODesaAWxYhkdfItmnY/IPTl1cjzQkcRQYJewBpWm0uIqwlgQ/wGGu0b rwVg== X-Gm-Message-State: AOAM530cA0+4KBbjRvFf1Hh5lphUyWU7jbNcbw0ebMr34WXHZMctsH1u XaWS4AxZa6Z8ba1vcqK+OCB99Q== X-Received: by 2002:a17:902:cec1:b029:eb:66ee:6da0 with SMTP id d1-20020a170902cec1b02900eb66ee6da0mr12545445plg.84.1619334859473; Sun, 25 Apr 2021 00:14:19 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id h8sm8767125pjt.17.2021.04.25.00.14.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Apr 2021 00:14:19 -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 v21 8/9] mm: memory_hotplug: disable memmap_on_memory when hugetlb_free_vmemmap enabled Date: Sun, 25 Apr 2021 15:07:51 +0800 Message-Id: <20210425070752.17783-9-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210425070752.17783-1-songmuchun@bytedance.com> References: <20210425070752.17783-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 --- 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