Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2809019lqp; Mon, 25 Mar 2024 09:46:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUv73629ZLQxiD4P51yjKiqXmfV/30P5smZ0klse4JWz02MDULWi8UpEc2EBgeBuvBS8CITY0Du+DwdBodSRxbxSMwe2pDH95rFrqXsxQ== X-Google-Smtp-Source: AGHT+IFUU1JQiwmSZK1UZvwakmsKc9SOsNyTl8XLd02kGz6qu/F/DadOSjGq+CPc+dA85hmqc4oY X-Received: by 2002:a05:620a:371d:b0:78a:49ff:41c6 with SMTP id de29-20020a05620a371d00b0078a49ff41c6mr10091047qkb.17.1711385185958; Mon, 25 Mar 2024 09:46:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711385185; cv=pass; d=google.com; s=arc-20160816; b=QWv5Qr7BblaXn5E7P/fz4hDK01hL/2ySRulwIYC4WWACR1htZv12xvw7NUHU40igCB 0LzKMcR/V6WnSu9VOOUVzeWy5ps8jGttOco18hsBN0NFXSa3yMA5b+8d2yCfQPYiSMvQ soXLSgELlEwrNC+vAPEe/tJF/fwhvEgSfBUts70/p59sB8/XxURXBvDPhwEaQ2WqAT6m WVWaAfUhIF5ltQB5weie34DgDYLqdw90CiqzVGcD+DZX18D/VtvGNtv5FbvcGgG7yE7z m7MDb81EexTNTL6LKgjmQk3nL7eFpPYJK61erxYIWWEB/6Pj+12TwhOSHD89mWlN0oUy pN2g== 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=MVO6euUmFTCPCHk6L2/T00GcEz6lDO4YO+24ug8h660=; fh=c/oh5Up+S96DG6r/ur5MAfFIcXhUC0de4lfxNiuupEI=; b=HdL9dfLviQV6C7jCZkXEpcWXo1qT8ZRkhmNO6lc1FlLZf0vVC3KCx6xPzqyJSRjJl4 0fskok9uRnQWvh2dB7Mpjl/7slIEb6RPIdyVNjmKBHPovM5uFrJiU/qer9pt4QJ71luk KhjAGH91wXmyLc4aOmW1rCRjQsounoNyqHRO4sDxyH9X3yhSrHVQ4680RO5kNiHDZmc8 tLIYkeYOJSgprN5yumdtuInI7fvDXXWeMqkIMsAQ5K7RrJzddY5FSe4Lg3zfsJMp3fA+ dGd0iEnFnqf06ck4Agjl7oyswwA11Db8L8pSXYUu+/3kqlyEIDAblgA0zqYfi5Zetuaw h+UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8TFUAdq; 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-117314-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117314-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 u17-20020a05620a455100b0078847cac6e4si6174791qkp.484.2024.03.25.09.46.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117314-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=Y8TFUAdq; 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-117314-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117314-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 A82F01C2CFC5 for ; Mon, 25 Mar 2024 16:46:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD2B6173353; Mon, 25 Mar 2024 14:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y8TFUAdq" 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 7D560172BAB for ; Mon, 25 Mar 2024 14:57:40 +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=1711378662; cv=none; b=I0m3zf+FOYCqhgvITIL5I9VmiTXsRD0E1lDmXxCFtb50Gl4Df0EvKHSgZa0TLL8vYY5EChqZpqmKCf4BtJMohUI7H7sOmKBdK8jIVYT4OfmyhJGhA2ERO5kqj6p0jKnLZCnV6hj66uaCZGB1tG/cGqy89TYujoc7eD5zIquC/LQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711378662; c=relaxed/simple; bh=u9X0CB3RPiuglgfjF076zJXtAcTpbFFY2pMKpioSodE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=ViZRFTniMh1ZXvUiXDWfdN1dRph2K47fs92/LPZu++N2nyCFlVrpZ/CzqkaDJGJ0ypkOWC1n1hxj15vQiqxb6Y4ZgzVGNz/X+Q7c/ocRypDl4CY5hxl+XjNoLc4VIgxNCOHOajd5K0JxDpUSNqkTKAPmcXsyfXFIJ5gYEdo23Wc= 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=Y8TFUAdq; 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=1711378659; 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=MVO6euUmFTCPCHk6L2/T00GcEz6lDO4YO+24ug8h660=; b=Y8TFUAdqZZaorxa6P2UtKKFHsUU/GrXczkSoFL5yX5DwqU8f4HBrs7vlV11M1yWT8Ulk7I e977XArYUmZBCv4SI0XhcL/FHqKyV6/iJxPN8WGAaz+79Cz3OobQ6aPoEuQ5ess6wmANQf ByxLDe+cvXI6hBvnP73wUT8jGv6DGZE= 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-124-mGMwkjhzOPWXpLUha1kWiA-1; Mon, 25 Mar 2024 10:57:37 -0400 X-MC-Unique: mGMwkjhzOPWXpLUha1kWiA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 3E7FB8007A2; Mon, 25 Mar 2024 14:57:37 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69A9D3C22; Mon, 25 Mar 2024 14:57:33 +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 v2 5/6] mm/mm_init.c: remove unneeded calc_memmap_size() Date: Mon, 25 Mar 2024 22:56:45 +0800 Message-ID: <20240325145646.1044760-6-bhe@redhat.com> In-Reply-To: <20240325145646.1044760-1-bhe@redhat.com> References: <20240325145646.1044760-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.1 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 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