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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C1933C433C1 for ; Fri, 26 Mar 2021 08:55:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1BDC2619FC for ; Fri, 26 Mar 2021 08:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BDC2619FC 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 8A19F6B0036; Fri, 26 Mar 2021 04:55:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8517E6B006E; Fri, 26 Mar 2021 04:55:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F2176B0070; Fri, 26 Mar 2021 04:55:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 519366B0036 for ; Fri, 26 Mar 2021 04:55:08 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F21C36C0B for ; Fri, 26 Mar 2021 08:55:07 +0000 (UTC) X-FDA: 77961415854.10.C8BBB53 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf02.hostedemail.com (Postfix) with ESMTP id DA6A540002C4 for ; Fri, 26 Mar 2021 08:55:03 +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 4B797AB8A; Fri, 26 Mar 2021 08:55:06 +0000 (UTC) Date: Fri, 26 Mar 2021 09:55:03 +0100 From: Oscar Salvador To: Michal Hocko Cc: David Hildenbrand , Andrew Morton , Anshuman Khandual , Vlastimil Babka , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range Message-ID: References: <31c3e6f7-f631-7b00-2c33-518b0f24a75f@redhat.com> <40fac999-2d28-9205-23f0-516fa9342bbe@redhat.com> <92fe19d0-56ac-e929-a9c1-d6a4e0da39d1@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DA6A540002C4 X-Stat-Signature: aps4f1ibpomshidi4oaccpbb9k64ccck Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1616748903-451452 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 Fri, Mar 26, 2021 at 09:35:03AM +0100, Michal Hocko wrote: > No problem there. I will not insist on my approach unless I can convince > you that it is a better solution. It seems I have failed and I can live > with that. Well, I am glad we got to discuss it at least. > > +static int memory_block_online(unsigned long start_pfn, unsigned long nr_pages, > > + unsigned long nr_vmemmap_pages, int online_type, > > + int nid) > > +{ > > + int ret; > > + /* > > + * Despite vmemmap pages having a different lifecycle than the pages > > + * they describe, initialiating and accounting vmemmap pages at the > > + * online/offline stage eases things a lot. > > This requires quite some explaining. Definitely, I will expand on that and provide some context. > Yes this is much better! Just a minor suggestion would be to push > memory_block all the way to memory_block_online (it oline a memory > block). I would also slightly prefer to provide 2 helpers that would make > it clear that this is to reserve/cleanup the vmemamp space (defined in > the memory_hotplug proper). Glad to hear that! By pushing memory_block all the way to memory_block_{online,offline}, you mean passing the memblock struct together with nr_vmemmap_pages, only_type and nid to memory_block_{offline,online}, and derive in there the start_pfn and nr_pages? Wrt. to the two helpers, I agree with you. Actually, I would find quite disturbing to deal with zones in that code domain. I will add two proper helpers in memory_hotplug to deal with vmemmap. If it comes out the way I envision, it could end up quite clean, and much less disturbing. Thanks Michal -- Oscar Salvador SUSE L3