Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp142429lqh; Wed, 27 Mar 2024 18:24:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMi+A8iPmB0OzKXO50WRQbf+XFSXbKpyk3KErDM6cxQaq9pDRQT6k5cPF5wf9ilGBC5Dl3DqnfBvR+ayqgiNo81SSsPsuLIdo3kgUHNg== X-Google-Smtp-Source: AGHT+IHVVXm/iGooaCXrt13kI0Mq4fBQORFl3mt6UsiBZLc3p7+5VQadAx3nUEiYtFQL7D95pkqg X-Received: by 2002:a67:f3ce:0:b0:478:4062:4d82 with SMTP id j14-20020a67f3ce000000b0047840624d82mr1951425vsn.9.1711589088612; Wed, 27 Mar 2024 18:24:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711589088; cv=pass; d=google.com; s=arc-20160816; b=H/GKy++Fb/2cAA/5J0CVRiSSoGS3O7fTOQXyNufsYgxxxP5Zib2v9H6aqsRW05BpKH KKvteKY3uuzcUlKz/LuH4y1Z7q4jPrsETnKoLoGB0z8Ra99UN7JRqsO1S8PJwDWlF3pS 97JfGEwhXe0qcn0DHH3SR0ShzEt4svC8TmLQD72H3tmbD3QWBRBcY3jg/rwpLUHUZNyd UcBt3I9rr5+LjUj+H1nOzTBpzWnkKgxU08ZPOH9SmjSWrb2CLMIwv+AEJZu3fu7GOshx anDtC4uqpACN2Q3qrN0uiw1lFgAlAqShaFQk8Bh9MHodEGJTwGQBwQHVDHWLYP/gZqU7 6BgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LilcHusgSvqim2+d+06wj9NkX9jRJyVASh1CxKYlBM4=; fh=smc9EHtY7RJf9+fv+Z6wjjmC/KV3iHouIV5F+Ma95GA=; b=MW+rux08drXqdqsVGs1GoAoM85MiEmv7wS5roTD3ouvkdNHm5/7m87PU+p/BDJh9tS 9uVYXOOS/lJIOgVaG8JeDfwOU+5LU9tKynStJpijKj8TC+wor+VKPsQjLh/Pkpxy66ho 03+9RgcIrRCBPNuvpEY9RqeYBTQRH8nS+oPkwikxZrwqZQaoitWgzKVbgSnKHx9hIDXX 0rop76tnNBGAW2xLVvjwWP0Pw6mLCXAbnDmTbD2V4KvS0Z+ExZy7Ch/iaETGG9qdqKeN mlWXxKONzU8koHigUgmFEPnzGMGAY997hZDpWjYIZfC2jW9jzRrIidPo4l30hFrvusoC ntJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hGZ43+hh; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-122273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j20-20020a37ef14000000b0078a4639dc11si425900qkk.324.2024.03.27.18.24.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 18:24:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hGZ43+hh; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-122273-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 572071C2AA04 for ; Thu, 28 Mar 2024 01:24:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CB26208D4; Thu, 28 Mar 2024 01:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hGZ43+hh" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D920D20335 for ; Thu, 28 Mar 2024 01:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711589057; cv=none; b=Ryc8z3atIpz4Q2OMfrLF7O7lO7XSPdUo90PqcdbmCqva0PpMkGYuj3xc1R4yIunvHtIUzIGh5NUAEtA8XoyyWlk4ccrn6fEsAFjKkInCGoOZqhKA2geZ21pwCZ0kS7qrokMWmX68MKg4xLaqTb0rxgGonpGTdOK9wzXTC0UiexE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711589057; c=relaxed/simple; bh=ZZr7QMnpNZnEM1qk3f4Iie1kMDltD45Dk+8VBSIy2Sc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dB9s+4Md2LeD3D2tSJP7E4uLEK4yF1ZIxgejKWNqSfkdR+Eb8jckXqp/7NTZceDFbj53jd072nqu2eZ9WF3b7+oczpeVPz3xvD2of8ZPU1etuDLrvkz64qIJCgm1ajKR9o52x7fTtSjam3JM/30TNFJ/q9Hx5azGER9n8hIvIkc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hGZ43+hh; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711589054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LilcHusgSvqim2+d+06wj9NkX9jRJyVASh1CxKYlBM4=; b=hGZ43+hhNcktTcHRNrXw9xRuQiLJimSPlwcATD9l628EM1IcYX362/4Riq+mQBgiCgWGqn TYHJnXmCUc2O4miqkAgA9MHZ2kCX46fDC+bS3nheCG6H22euwv4ymoht7Vn71/ZU2OhwaV DZ9MIfQZ3tdNOpQHk0Cy3qieLA05GZ4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-96-pbODCuinOoimN5IXwG6ifw-1; Wed, 27 Mar 2024 21:24:10 -0400 X-MC-Unique: pbODCuinOoimN5IXwG6ifw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 238DA3C0EABF; Thu, 28 Mar 2024 01:24:10 +0000 (UTC) Received: from localhost (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5369217A9D; Thu, 28 Mar 2024 01:24:08 +0000 (UTC) Date: Thu, 28 Mar 2024 09:24:01 +0800 From: Baoquan He To: Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org Subject: Re: [PATCH v2 5/6] mm/mm_init.c: remove unneeded calc_memmap_size() Message-ID: References: <20240325145646.1044760-1-bhe@redhat.com> <20240325145646.1044760-6-bhe@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 On 03/27/24 at 06:21pm, Mike Rapoport wrote: > On Mon, Mar 25, 2024 at 10:56:45PM +0800, Baoquan He wrote: > > Nobody calls calc_memmap_size() now. > > > > Signed-off-by: Baoquan He > > Reviewed-by: Mike Rapoport (IBM) > > Looks like I replied to patch 6/6 twice by mistake and missed this one. Thanks for your careful reviewing. > > > --- > > mm/mm_init.c | 20 -------------------- > > 1 file changed, 20 deletions(-) > > > > diff --git a/mm/mm_init.c b/mm/mm_init.c > > index 7f71e56e83f3..e269a724f70e 100644 > > --- a/mm/mm_init.c > > +++ b/mm/mm_init.c > > @@ -1331,26 +1331,6 @@ static void __init calculate_node_totalpages(struct pglist_data *pgdat, > > pr_debug("On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages); > > } > > > > -static unsigned long __init calc_memmap_size(unsigned long spanned_pages, > > - unsigned long present_pages) > > -{ > > - unsigned long pages = spanned_pages; > > - > > - /* > > - * Provide a more accurate estimation if there are holes within > > - * the zone and SPARSEMEM is in use. If there are holes within the > > - * zone, each populated memory region may cost us one or two extra > > - * memmap pages due to alignment because memmap pages for each > > - * populated regions may not be naturally aligned on page boundary. > > - * So the (present_pages >> 4) heuristic is a tradeoff for that. > > - */ > > - if (spanned_pages > present_pages + (present_pages >> 4) && > > - IS_ENABLED(CONFIG_SPARSEMEM)) > > - pages = present_pages; > > - > > - return PAGE_ALIGN(pages * sizeof(struct page)) >> PAGE_SHIFT; > > -} > > - > > #ifdef CONFIG_TRANSPARENT_HUGEPAGE > > static void pgdat_init_split_queue(struct pglist_data *pgdat) > > { > > -- > > 2.41.0 > > > > -- > Sincerely yours, > Mike. >