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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 64D5AC433FE for ; Wed, 9 Dec 2020 09:37:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 228F023B79 for ; Wed, 9 Dec 2020 09:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729175AbgLIJhD (ORCPT ); Wed, 9 Dec 2020 04:37:03 -0500 Received: from mx2.suse.de ([195.135.220.15]:52180 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728311AbgLIJhD (ORCPT ); Wed, 9 Dec 2020 04:37:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 039D4AC94; Wed, 9 Dec 2020 09:36:22 +0000 (UTC) Date: Wed, 9 Dec 2020 10:36:19 +0100 From: Oscar Salvador To: David Hildenbrand Cc: mhocko@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, vbabka@suse.cz, pasha.tatashin@soleen.com Subject: Re: [RFC PATCH v3 1/4] mm,memory_hotplug: Add mhp_supports_memmap_on_memory Message-ID: <20201209093608.GA30590@linux> References: <20201201115158.22638-1-osalvador@suse.de> <20201201115158.22638-2-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 10:36:54AM +0100, David Hildenbrand wrote: > Instead of adding these arch callbacks, what about a config option > > ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE > > that gets selected by the archs with CONFIG_SPARSEMEM_VMEMMAP ? > > The mhp_supports_memmap_on_memory() becomes even more trivial. I think that would not be enough. E.g: s390x supports CONFIG_SPARSEMEM_VMEMMAP but it does not support altmap (and maybe other arches I did not check too). That is why I was careful in choosing the ones that a) supports CONFIG_SPARSEMEM_VMEMMAP and b) support altmap > > Note that mhp_memmap_on_memory kernel boot option will be added in > > a coming patch. > > I think it makes sense to > > a) separate off the arch changes into separate patches, clarifying why > it can be used. Move this patches to the end of the series. > > b) Squashing the remainings into patch #2 Ok, I can do that. > > +/* > > + * We want memmap (struct page array) to be self contained. > > + * To do so, we will use the beginning of the hot-added range to build > > + * the page tables for the memmap array that describes the entire range. > > + * Only selected architectures support it with SPARSE_VMEMMAP. > > You might want to add how the caller can calculate the necessary size > and that that this calculated piece of memory to be added will be > accessed before onlining these pages. This is e.g., relevant if > virtio-mem, the hyper-v balloon, or xen balloon would want to use this > mechanism. Also, it's somewhat incompatible with standby memory where > memory cannot be accessed prior to onlining. So pointing that access out > might be valuable. Sure, I will be more verbose. > You can simplify to > > return arch_support_memmap_on_memory() && > IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP) && > size == memory_block_size_bytes(); Yeah, thanks ;-) -- Oscar Salvador SUSE L3