Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp157590lqo; Wed, 27 Mar 2024 09:22:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtsRXQOOmAMlJqJjAcApObpeaKTMcxWs2tFSDI2QNK7AR1rIbZZw90aKqNZ2Gy2Gmd5tROxWsIJbflz/7UfLNQ+SVTZJlfb+R4/DlDGw== X-Google-Smtp-Source: AGHT+IF0xjLqyFhAgYn5NL5akGPt+XFjWR5hGf8jPR8I0Hucf0Cth8AfzMvvzRgJ+7+aykTbzW86 X-Received: by 2002:a50:d7cc:0:b0:568:d315:b85e with SMTP id m12-20020a50d7cc000000b00568d315b85emr175519edj.36.1711556531940; Wed, 27 Mar 2024 09:22:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711556531; cv=pass; d=google.com; s=arc-20160816; b=Wjpg/OcqkvycACqEcvXrX/+q4Nh0vKlcINkNsKzfMj4UBLMd7SWNsvbvdzIHYEzOtF GcyWiUNUL3Cs3e66gml7FB9NAKnfr6iXY0iMuRXcUbKKyGTM1HrSeYxJkwRG0ok8z8gh 3zM9Dtra0G6C+t3vAO79NrVqFFt3mXNfKTASafjlY84AjseWsm/DySMDplrBP7YWry4n hhJfAWMN45DzAkUUP0xE4kK54nAIJ3gbc/1ItqdK+jvqMhVY/flEHpn+tGrWd1es18gN FLsPcFCTvyfIBnjFk/8r86FlZP6B8myoSivdLZgCAkwW0VoesF+iacGg3erXIHXMrO2B kytA== 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=g4Ro1diaAhpyahkrIs4Gfq8gHs90ko+mPMzWttBtxqw=; fh=KGm8PY/IetsVJWKK6UNUWrv2dd7n9qXKtm51kzc4YLY=; b=XMv5OpRslDLTv/9pdddogvV7Et/HMpVvavaUDMF7ftNKcqHvynU3/q1qCXpPKWxOYU T7YPjLia2uY/kApapVcMkBDd1X90mPmuT3BvAqt7A81A8XU2aIRU3S5nxLwTapogHmjF YJXSiSLALVQ+92oXvqJtlLcrEL6PkeRpiZUD55oH7aer9q9lfIeNjeO7cpk0DiBETZsO +ZjgjF7B6NZdNooiOJ6gLqKJlywSKpzbWfSEjeCTFtEJBfeA2GbxIleNANY37E60IuDQ G95vlZpLkPZbLgnCJ5CePJ0jPJq1lWxmNKCtx6dfljO+5VCCvjrhNVDUFn21RCJiDT2e alTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IavBJGsz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r25-20020a50aad9000000b0056b849263c3si4868456edc.438.2024.03.27.09.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IavBJGsz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 88D1E1F336EC for ; Wed, 27 Mar 2024 16:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D650130AF0; Wed, 27 Mar 2024 16:22:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IavBJGsz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AFCBA12F596 for ; Wed, 27 Mar 2024 16:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711556524; cv=none; b=qCyIVoKmhyuqIcI6UVMhklMwBOaTpxK2RY/9FbrykryqlBRYUQNML7vQqq/yCHLEMumy9n4LCcQ1OIN2pFoaNQlkArMGAgTiwMixnMAHvWB72fjxvrJiQPyfzDcMNeg7I3g6J62b7SZWSXj5jEelNM89L9JSlddwRjCvlzpQQX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711556524; c=relaxed/simple; bh=/HwfEIPp2rgEplQNov6HPpeEoXKzTzryrZH4IYBxJHY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FQSr/lk138eOTm4D5DP6CGxpzAK/owgCK3z6VTAoIyQN+vZQcuf502CIn5YLT47zzlDLH9P4F/NLV5gCOhKYhjfBLJh3AJ5voer+Ev5FTncHc9AaC5bWvk8y8DoW6bzqUdSxR8luYy1RrcmXVAdnswyp5bDxhHu6+huMPUu/XAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IavBJGsz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE561C433C7; Wed, 27 Mar 2024 16:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711556524; bh=/HwfEIPp2rgEplQNov6HPpeEoXKzTzryrZH4IYBxJHY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IavBJGszFmAlc2pEn+zfe6ZTmvjuzS8OniqKBl3fq326ok4Z1/lQIFhubB5J3YlF+ UJ7cH6fmsukvoIbMe+qb0s38Dpb5PZkO6MeQepUNQjTYesXIsI7Tt6Okk8maBGjSOE 2ZjVJLDIGgdH9xzzcM3kKRi0rqL4LQ0EAJjGeovCvCD4A6h/kwamy8QttJ8EIgV/zp IzQAw0jKezVA3KsiiT8nk7Tn7rm+KI1haka80NRE9CgIVAe6TudWIlsqAq3Su1BT8/ j2oRBxYxdj1bTB2sEPjNeWwA+TXigfhS5Lc9NBty0edAy6fDSDCpgqHNsZ1UG/5piz SSHvZMjybuQKQ== Date: Wed, 27 Mar 2024 18:21:20 +0200 From: Mike Rapoport To: Baoquan He 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: <20240325145646.1044760-6-bhe@redhat.com> 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. > --- > 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.