From patchwork Mon Mar 25 14:56:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13602377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29D5AC54E58 for ; Mon, 25 Mar 2024 14:57:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0ABE6B00A5; Mon, 25 Mar 2024 10:57:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABA6C6B00A6; Mon, 25 Mar 2024 10:57:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 982546B00A7; Mon, 25 Mar 2024 10:57:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 84C7C6B00A5 for ; Mon, 25 Mar 2024 10:57:32 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4D5CD120837 for ; Mon, 25 Mar 2024 14:57:32 +0000 (UTC) X-FDA: 81935865144.06.17D326F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id B555940018 for ; Mon, 25 Mar 2024 14:57:30 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UAARgC5L; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711378650; h=from:from:sender: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:dkim-signature; bh=/wvoO9gMxnE/h+72mDdUoxwDkamBxujn5JY0mQMrkk8=; b=fBY9Qn5dAM52Z3U1ldME0RZsZjxQQcjlSmWCP4hFMiBbkfFiLnkZPWQeUAsyucO/kdSsHI zjNhOdeQtSjrDuFweSzy0NFoeB2+hcZrK6HbTfGiy1OaH1CqVhWt1ESDsWMqB7YE5OEHKh 9Zibe6MYhUwmX5q4il42jCHcaHnfPA8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UAARgC5L; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711378650; a=rsa-sha256; cv=none; b=5henHslIlckUXnzYuAHfLSgaLeFyFGI95Ll+FK9Z8NFXIr9TZXG1WOgg/YiP5GTgF9ELe9 D8zZXFs1DEWBYFWmchJq4q8z7ZUhtsb5rNbAbj13PqFi8tdP6zZ6xwXgeR8pnFwwg6cXaD lDWuiDiBB1LW+smIgGdB1wuqu84Azpc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711378650; 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=/wvoO9gMxnE/h+72mDdUoxwDkamBxujn5JY0mQMrkk8=; b=UAARgC5Lq9+648tqMb7yuqXxLB4mJ30U1QL8wqpXUssmUz6it4xMVXfK6dAoMR6JOJAK2A 66BBS0TDcjNT8Hd2KScmB1trlAF1zE6Bo38iff7G54s5dZOtP325bduj4+mLs7G/p1+UeP kKvwzBUCF5hqWJZLS9nwaAU/0OoO0IQ= 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-207-ioNvZiFePKuhU6aVg6cs7g-1; Mon, 25 Mar 2024 10:57:25 -0400 X-MC-Unique: ioNvZiFePKuhU6aVg6cs7g-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 38444185A783; Mon, 25 Mar 2024 14:57:25 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E4133C22; Mon, 25 Mar 2024 14:57:20 +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 2/6] mm/mm_init.c: remove the useless dma_reserve Date: Mon, 25 Mar 2024 22:56:42 +0800 Message-ID: <20240325145646.1044760-3-bhe@redhat.com> In-Reply-To: <20240325145646.1044760-1-bhe@redhat.com> References: <20240325145646.1044760-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Rspam-User: X-Stat-Signature: 6wjhhctm7yk9jdixuk11y9p6pywekz1s X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: B555940018 X-HE-Tag: 1711378650-969852 X-HE-Meta: U2FsdGVkX18dZpEYqkRRHzhqMPB6tMES1PGOqcN6bXmIKJIrTgrSDuHaJkgp1VrMeL2ZbWXfufp/eZ5s+FI8x0aOlINP7n6+Cn9Btk87moXhiGiES7V33zZyBA6LSvHt+UX2IrZ1sSx7IOyJpaPvOsw0IvqY1/aDqMn1KzDOYueDE+myr1VbBGRuE4i1B/6y5g75VwSq+eLOMmIJ7hmLtjYgaGxDtKOC8KB7BFtmn3P0TUYD9kkr29egh1YTcdLK7j+q4inxahNfwQ44qq+dAvYpAP6gXiDqBG9irGYKpE78TaWz5tRRXq2FDvYvSMG1J1gsu0t89ppNDbsQbvA+y9qzCl1cDGAOrxMISybzQ79GWqokRvgrZwHVnlJ9tGjSstQJ8RloqhSzgmcO63gzphHNdPBV6k02fesaF/UQjSDJnLIhM7Wk59o70n1JZDCie4ea0rUHGEgzu99mutUtRrCPQ3aSKrMi49VLZtex902g+VhbgQ1rh8r2suz+LQ8MP5l9q0BlXGdjMwH885y0mw+rzE650fH8tihxOkJQ49lU/+6qhpTe7UhF0EWHhTaMLaxPJazcyUz9MURz5oHK7H9pGPFiWIflXeEPWDPC81C37oXCp9nW17IrY4N/oM8i572RuCRWx78oG/mAYE989JOEt5y0R5byRpSpaAZKGnKLSRgQ1Ksescv2b1mRvJ3S5/aE0MiCvoy5bFQwcegSyKIVxQDq333GeJxtRsnVsXy4fZvmlYeODFTFAvhetSmA1tew5dAV3kVXEpWLfK+eNGaA/rct8ZDZRNX6Rx7Bp0Cs7hcIY0c96rTPCo1tc11I/hrh1GyJMzj1zMEICTy2XvCSobrEKfQAM5GN01Spc/ODcvkYBJKLQl/yvkW6UNvdG4k86RAsiuqmoo9VvvIqsxXEF8b+KmreJg+n1ixANuWwWmxW5r00aGPeBZxO4vmU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now nobody calls set_dma_reserve() to set value for dma_reserve, remove set_dma_reserve(), global variable dma_reserve and the codes using it. Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport (IBM) --- include/linux/mm.h | 1 - mm/mm_init.c | 23 ----------------------- 2 files changed, 24 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0436b919f1c7..ad19350e1538 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3210,7 +3210,6 @@ static inline int early_pfn_to_nid(unsigned long pfn) extern int __meminit early_pfn_to_nid(unsigned long pfn); #endif -extern void set_dma_reserve(unsigned long new_dma_reserve); extern void mem_init(void); extern void __init mmap_init(void); diff --git a/mm/mm_init.c b/mm/mm_init.c index 549e76af8f82..153fb2dc666f 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -226,7 +226,6 @@ static unsigned long required_movablecore_percent __initdata; static unsigned long nr_kernel_pages __initdata; static unsigned long nr_all_pages __initdata; -static unsigned long dma_reserve __initdata; static bool deferred_struct_pages __meminitdata; @@ -1583,12 +1582,6 @@ static void __init free_area_init_core(struct pglist_data *pgdat) zone_names[j], memmap_pages, freesize); } - /* Account for reserved pages */ - if (j == 0 && freesize > dma_reserve) { - freesize -= dma_reserve; - pr_debug(" %s zone: %lu pages reserved\n", zone_names[0], dma_reserve); - } - if (!is_highmem_idx(j)) nr_kernel_pages += freesize; /* Charge for highmem memmap if there are enough kernel pages */ @@ -2547,22 +2540,6 @@ void *__init alloc_large_system_hash(const char *tablename, return table; } -/** - * set_dma_reserve - set the specified number of pages reserved in the first zone - * @new_dma_reserve: The number of pages to mark reserved - * - * The per-cpu batchsize and zone watermarks are determined by managed_pages. - * In the DMA zone, a significant percentage may be consumed by kernel image - * and other unfreeable allocations which can skew the watermarks badly. This - * function may optionally be used to account for unfreeable pages in the - * first zone (e.g., ZONE_DMA). The effect will be lower watermarks and - * smaller per-cpu batchsize. - */ -void __init set_dma_reserve(unsigned long new_dma_reserve) -{ - dma_reserve = new_dma_reserve; -} - void __init memblock_free_pages(struct page *page, unsigned long pfn, unsigned int order) {