Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp266970lqt; Mon, 18 Mar 2024 07:24:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrIDszmClo7PjOmhMKv4zKRmwwrUowk+oXTbMS1SRFKcfRgYYMkNvrdhx22Ah31oDEdquo+i7x78o6eTOV+b7wMZOjdA0poZHwENYC/g== X-Google-Smtp-Source: AGHT+IGoZGXSFWIlTitV55CK3t8rfP8NrEW8gqZHnPZ+3zEljANjMlZB6TzeHNngaXymAqx0xp3v X-Received: by 2002:a05:6a21:2d8f:b0:1a3:4c9d:18f3 with SMTP id ty15-20020a056a212d8f00b001a34c9d18f3mr8081528pzb.55.1710771873133; Mon, 18 Mar 2024 07:24:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710771873; cv=pass; d=google.com; s=arc-20160816; b=EP98rtC8D+Avvtl1b+7lTgN6lAyiS1yw8PsFdiZe2caxzXupqyShsuPDMG4xJIHBy1 6fXomESwhZqpR/CRPi0xwKWoFUIPKlTH9KcjuC5T66TR4Wr0MA7WZkvcxLDMm8Ch45DC DiPKlY64cOqK1TogtF9wBwc7kl6b8KyEH861dhs+MgB1CFIH1Bnbmeb3oPIg754p0uHU pjoRUUbzyhN4bWoDzI/EGs9zKyUvszK6oJ8ToOQvGyylxNY+wILqqVdIo5fRS1q1HcL5 6LEigclE+LslAYb9BbKDSDETtlJk41sC3lSUPvQ5ckgFxc7kxPHYFovY7Pi1KbHTq2UK leoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=D/H22rgu+0Eg3oELZT1F8mB3L7t/pq1y95Fbs8e1Y/U=; fh=c/oh5Up+S96DG6r/ur5MAfFIcXhUC0de4lfxNiuupEI=; b=hY0SenEdn3DErxE8NBFixrqNJ1my+00LdTM8XmQnDwYToOWH4fDDV/Agph1dZNTlHo tQkJQEmFYIeXPHZosa0l4r3pWJ1+uVwbdCXgsfT+wvvmSr/aAKHX2+PLSubt6aaWERIw rfo8GA7e5iTPl3MvKfTG58kdpB8qoOYDKmFIMe3kk96gTbPTQSLbJsKgB6uDcQqi+zNA /AzOOj4/Jcns1GzxmNwxS49gWYokGKWvWIf39GOYg6JC4BBRXR5V3X+/l2MiI55GTaCw zdlGQkg7GethxfYWzhsyNsl5SQc8qz8qbh6bnCcfRohAGlmm9ZVwKcr/I2wKekiI5VrK oBmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VylSzZAr; 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-106214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106214-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e21-20020a63db15000000b005cdf89f64ffsi8097297pgg.482.2024.03.18.07.24.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 07:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VylSzZAr; 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-106214-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106214-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D6F2FB2291F for ; Mon, 18 Mar 2024 14:23:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 280D950A70; Mon, 18 Mar 2024 14:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VylSzZAr" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 D870950249 for ; Mon, 18 Mar 2024 14:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710771734; cv=none; b=W/5aXp59SWewdIYU/s5OKC1LLOyjLOb6nHFXvaOz5TspJsDJ9hQ55xdT0INHBUKU6oxbSY/OwbTsPVXuqn+sbJuhvbQAS2YBv0in8nKbenInlqQHWUjiZAaD0ltSRVQ5XNM9O33RUixRtEjS1M9wmf7mcNeXdTsAfPye8I51G4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710771734; c=relaxed/simple; bh=aCpM8olVWTDqlQQ3qCGzzgkbORWDHDqfLUd80t/l6Jc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=AQmVZZ5LjTZ8ZXUXLcCkLZQMsb20tMwO+Oezx1Mz9QlSiN15eDp9+ZIFkxH7BIgv3dHmehv+U6W4V24b+Txn1JG5sTxCy529l15VpGKDbj9hb4UuXZ8J/w+jneY1HZUe2Fr1LTRS2mTY63NCURrTg9uEiIFcd5tNV5f7CWTi/zg= 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=VylSzZAr; arc=none smtp.client-ip=170.10.129.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=1710771732; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D/H22rgu+0Eg3oELZT1F8mB3L7t/pq1y95Fbs8e1Y/U=; b=VylSzZAreP9kRBvSEZa64BanHcu9Barai+HSKGWraD6eFrEWtWHs2mpVXIK/HHrN1uVchG vRl/YX9YEMgZlfNi1gicBs9TFYcXfr+TG+8Amy8ISblrfKqKUbmthVEOo2uIiNMOYqtJTb QOiDk7uvTnwEt3MBgwrSa0HX8p930rk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-43-gnPigdkEN5yTi6k7RKI_9g-1; Mon, 18 Mar 2024 10:22:09 -0400 X-MC-Unique: gnPigdkEN5yTi6k7RKI_9g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 4F4BF800265; Mon, 18 Mar 2024 14:22:08 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65BA7492BD1; Mon, 18 Mar 2024 14:22:05 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org, rppt@kernel.org, Baoquan He Subject: [PATCH 5/6] mm/mm_init.c: remove unneeded calc_memmap_size() Date: Mon, 18 Mar 2024 22:21:37 +0800 Message-ID: <20240318142138.783350-6-bhe@redhat.com> In-Reply-To: <20240318142138.783350-1-bhe@redhat.com> References: <20240318142138.783350-1-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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Nobody calls calc_memmap_size() now. Signed-off-by: Baoquan He --- mm/mm_init.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/mm/mm_init.c b/mm/mm_init.c index 55a2b886b7a6..9ed4b9e77c4a 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