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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 94C1CC433E0 for ; Mon, 1 Mar 2021 08:45:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B6B764E04 for ; Mon, 1 Mar 2021 08:45:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B6B764E04 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C2DDC8D005C; Mon, 1 Mar 2021 03:45:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BDD558D005B; Mon, 1 Mar 2021 03:45:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2FBC8D005C; Mon, 1 Mar 2021 03:45:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 862CA8D005B for ; Mon, 1 Mar 2021 03:45:16 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 536EB180ACF76 for ; Mon, 1 Mar 2021 08:45:16 +0000 (UTC) X-FDA: 77870671032.09.ED4D52D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 561AEA0009CE for ; Mon, 1 Mar 2021 08:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614588315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NDfpZiBORFcwJhka5rTFwKHAeoR+PqV6dRvqqfDZlpQ=; b=V2fexq1q0y0AAX1ax+qaeRktwXEdGF7+ISKSo+vzDORYsCDQezMC2BMNKBrjozogVXXYRv Y3yQOooHNeN3FejAZo3DEQuVdecMS8/SZRsuddWypivmPhLwbpbfEbbh6T7H2w+ioVoTHo 5tkWcDO3sZumADuWwITOFf6TqJ/SY9g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-FA3ltOZ9O9SOY20SxFpyvw-1; Mon, 01 Mar 2021 03:45:11 -0500 X-MC-Unique: FA3ltOZ9O9SOY20SxFpyvw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC507107ACE3; Mon, 1 Mar 2021 08:45:09 +0000 (UTC) Received: from [10.36.114.87] (ovpn-114-87.ams2.redhat.com [10.36.114.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5188A60657; Mon, 1 Mar 2021 08:45:08 +0000 (UTC) To: Oscar Salvador Cc: Andrew Morton , Michal Hocko , VlastimilBabkavbabka@suse.cz, pasha.tatashin@soleen.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual References: <20210209133854.17399-1-osalvador@suse.de> <20210209133854.17399-7-osalvador@suse.de> <20210226120451.GA3661@localhost.localdomain> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [PATCH v2 6/7] x86/Kconfig: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE Message-ID: Date: Mon, 1 Mar 2021 09:45:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210226120451.GA3661@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 561AEA0009CE X-Stat-Signature: oq37sug6gsybt3rg47dcq36f3wazf1wt Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=63.128.21.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614588315-220631 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 26.02.21 13:04, Oscar Salvador wrote: > On Thu, Feb 25, 2021 at 07:29:07PM +0100, David Hildenbrand wrote: >> On 09.02.21 14:38, Oscar Salvador wrote: >>> Enable x86_64 platform to use the MHP_MEMMAP_ON_MEMORY feature. >>> >>> Signed-off-by: Oscar Salvador >>> --- >>> arch/x86/Kconfig | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >>> index 72663de8b04c..81046b7adb10 100644 >>> --- a/arch/x86/Kconfig >>> +++ b/arch/x86/Kconfig >>> @@ -2440,6 +2440,10 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE >>> def_bool y >>> depends on MEMORY_HOTPLUG >>> +config ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE >>> + def_bool y >>> + depends on X86_64 && MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP_ENABLE >> >> It depends on SPARSEMEM_VMEMMAP, no? >> >> I think we could have >> >> SPARSEMEM_VMEMMAP_ENABLE=3Dy >> and >> SPARSEMEM_VMEMMAP=3Dn >> >> on manually tuned configs. >=20 > I do not think this can happen: >=20 > from mm/Kconfig: >=20 > config SPARSEMEM_VMEMMAP_ENABLE > bool >=20 > config SPARSEMEM_VMEMMAP > bool "Sparse Memory virtual memmap" > depends on SPARSEMEM && SPARSEMEM_VMEMMAP_ENABLE > default y > help > SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise > pfn_to_page and page_to_pfn operations. This is the most > efficient option when sufficient kernel resources are availa= ble >=20 > and from arch/x86/Kconfig: >=20 > config ARCH_SPARSEMEM_ENABLE > def_bool y > depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD > select SPARSEMEM_STATIC if X86_32 > select SPARSEMEM_VMEMMAP_ENABLE if X86_64 >=20 >=20 > So, if I read this correctly, for SPARSEMEM_VMEMMAP to be true, > SPARSEMEM_VMEMMAP_ENABLE needs to be true as well. >=20 > Am I missing something? Take your config and set X86_5LEVEL=3Dn (because it enforces SPARSEMEM_VMEMMAP) and SPARSEMEM_VMEMMAP=3Dn When compiling, you'll end up with a config like CONFIG_SPARSEMEM_VMEMMAP_ENABLE=3Dy # CONFIG_SPARSEMEM_VMEMMAP is not set Yet, with your patch you would get ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=3Dy And it would not get fenced off in the code, right? I think you either have to check (IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP))=20 in addition in your code, or enforce it differently. Like config MHP_MEMMAP_ON_MEMORY depends on SPARSEMEM_VMEMMAP && ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE bool Then you can simplify the arch Kconfig settings, removing the sparesemem=20 dependency there. --=20 Thanks, David / dhildenb