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 65233C4361B for ; Wed, 9 Dec 2020 09:36:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C0EED23B7B for ; Wed, 9 Dec 2020 09:36:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0EED23B7B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 143F46B00B5; Wed, 9 Dec 2020 04:36:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F43B6B00B6; Wed, 9 Dec 2020 04:36:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 009056B00B7; Wed, 9 Dec 2020 04:36:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id D7D0C6B00B5 for ; Wed, 9 Dec 2020 04:36:23 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A2F928249980 for ; Wed, 9 Dec 2020 09:36:23 +0000 (UTC) X-FDA: 77573238246.20.shape55_1c05038273ee Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 84CB4180BFBAD for ; Wed, 9 Dec 2020 09:36:23 +0000 (UTC) X-HE-Tag: shape55_1c05038273ee X-Filterd-Recvd-Size: 3043 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Dec 2020 09:36:23 +0000 (UTC) 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) 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 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