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 6F877C433E0 for ; Thu, 18 Mar 2021 12:04:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C3102601FC for ; Thu, 18 Mar 2021 12:04:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3102601FC 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 1F7F36B0070; Thu, 18 Mar 2021 08:04:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A8906B0071; Thu, 18 Mar 2021 08:04:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 049866B0072; Thu, 18 Mar 2021 08:04:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id DF4A16B0070 for ; Thu, 18 Mar 2021 08:04:07 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9375A18018A11 for ; Thu, 18 Mar 2021 12:04:07 +0000 (UTC) X-FDA: 77932861734.17.4AF845D Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf11.hostedemail.com (Postfix) with ESMTP id 755B520007E2 for ; Thu, 18 Mar 2021 12:04: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 CA818AC75; Thu, 18 Mar 2021 12:04:01 +0000 (UTC) Date: Thu, 18 Mar 2021 13:03:59 +0100 From: Oscar Salvador To: David Hildenbrand Cc: Andrew Morton , Michal Hocko , Anshuman Khandual , Vlastimil Babka , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/5] mm,memory_hotplug: Allocate memmap from the added memory range Message-ID: References: <20210309175546.5877-2-osalvador@suse.de> <20210315102224.GA24699@linux> <20210317140847.GA20407@linux> <51c645b3-1220-80c4-e44c-4c0411222148@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51c645b3-1220-80c4-e44c-4c0411222148@redhat.com> X-Stat-Signature: 6fih7sq1n1epg7wjm3s9qsdw3supzqtr X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 755B520007E2 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf11; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1616069043-207357 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 Thu, Mar 18, 2021 at 12:24:16PM +0100, David Hildenbrand wrote: > I don't follow. 2MB == 2MB. And if there would be difference then we would > be in the problem I brought up: vmemmap code allocating too much via the > altmap, which can be very bad because might be populating more vmemmap than > we actually need. Yes, I meant to say nr_vmemmap_pages won't match, or IOW, won't have the same meaning. The end result is the same. > vmemmap_size = 512 * 4KiB = 2 MiB. > > That calculation wasn't very useful (/ PAGE_SIZE * PAGE_SIZE)? Yeah, somewhat redundant. > > > unsigned long remaining_size = size - vmemmap_size; > > And here we could get something like > > remaining_size = 2 GiB - 2 MiB Yes, vmemmap_size would need to scale with nr_sections to be relative to size. Just wanted to bring it up, because somene might wonder "ok, why do we have altmap->nr_pfns = X, and here nr_vmemmap_pages is Y" It was an effort to make it consistent, although I see it would bring more confusion other than anything, so disregard. -- Oscar Salvador SUSE L3