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 BDAA1C433E0 for ; Thu, 18 Mar 2021 12:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F117601FC for ; Thu, 18 Mar 2021 12:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230452AbhCRMEZ (ORCPT ); Thu, 18 Mar 2021 08:04:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:42708 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbhCRMEC (ORCPT ); Thu, 18 Mar 2021 08:04:02 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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