Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp265956lqt; Mon, 18 Mar 2024 07:22:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQJ5aH8WMa8SJAX8nnb/KLE+d9fevEGJ9+DpZ8MK2uTlBf8FiItVL879Zep6ADaHKTPK+pfkLQ5p72B79ssUZ9xcm2dX7X7E71qCtpIw== X-Google-Smtp-Source: AGHT+IEIX6TX0QjGZYaIqaDs1ZCG1OojPPqdGTq53KLwPuvTvltwEx1Knq/YlWjsmKHn1fDIuovV X-Received: by 2002:a17:907:a092:b0:a46:4d76:106b with SMTP id hu18-20020a170907a09200b00a464d76106bmr10674748ejc.34.1710771775965; Mon, 18 Mar 2024 07:22:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710771775; cv=pass; d=google.com; s=arc-20160816; b=rO+AKjtK8D2OogTBThmh7kUz1uuJ2hQQHZs1ni0+4YF7rR6o+vV1BsaoTr+mqMJ9nZ mbOEO+5MCrtA0WHmCKG85RrW7lCjuYiGu96Wh5oGyZdZ+cEMEGawBAo95mwSulcQUcxQ zlkfJ70SETw+Ec9SVy7HAOX3Gurn9OVPQ+Biz0b654BoyIbXBd3i6L3ubGdgKD7A0kpF Wcxr+gMyeHq4fpx0Z8ysx5dHu4NQLH4qhm2uKeDbQiBFXmG1AVAVJ2HN/R1U2JEx9OBQ V+LX0zYNNlb1rWVprY5p0klVz6ZjbZERUUctQL1aFMo4gcP7UtijnvMQdR1eeYlbrHU6 Okgg== 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=xwNlozyVa9wCKfV2gAvZZNhZ5jeQ/QZALXvKTp7xRLg=; fh=c/oh5Up+S96DG6r/ur5MAfFIcXhUC0de4lfxNiuupEI=; b=B8PWDae6yeiHrl7EjbgSQKn9Of8Cxfj0Mb+Ab111BHYEvCeAOUtftbFRaoBRBJTpHJ dN2GRuUQtP/ir5PWOtjRgeJe8d0MYjDiXRZjspQsCy7aiTQdM9yGAmhd4VLbkqUIHAnl jn+YJYCqCSxA5YBjYvxtwEr311LJGiS/i+dPUhc57UmIar2j9mFosJiy/OLHSQVPASaM af6s69wqWEltgfmB9ZHYlKIeOjAVi/Fy/t7ATHPpX91eMxx41L2zDlI0TzHUgj0eg6tg 5fN/Co8R0LoKEsCTy6swTpLN+ML3WkFTC8FfmM5zW3YsYUzOHOg2NyHkNZkG+cDJchyj +qvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AOXIyF2e; 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-106211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o20-20020a170906289400b00a464a2fc2fcsi4185290ejd.905.2024.03.18.07.22.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 07:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AOXIyF2e; 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-106211-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106211-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8B39A1F21028 for ; Mon, 18 Mar 2024 14:22:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 177AA4F1F1; Mon, 18 Mar 2024 14:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="AOXIyF2e" 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 8DBC54F1E0 for ; Mon, 18 Mar 2024 14:22:01 +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=1710771723; cv=none; b=Z5VvLqrhEkvcpsXNCwRIT5TQeC+1nj9orwRHwlZY54d0sbCX2xNtK1kEbqZ1dRGs+/SzlR3fjaLOZ0Sph9z3ZL3o0Hfdln8BhIUo+pELpwHlJrzcI1CBbRY0SRz4BpRnP3TEP1HXiQi8cWEDO9k5dRD1rnZ0Rb297KjUZ0PVS+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710771723; c=relaxed/simple; bh=vL+3nwtCcw8M17VzZsK3gpfBmV1kBIrG3mKYbU2z/+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=DgjAq/g8TTwH/MrzSn6oXckdBfD2YXsEOxRcAtkXK9waDeE//uhrBCNgN7C+R3vhIGW4zXAM7UwDUBvFEZHnb2OycaC/s4rPGx28Zrf17E56Q0Mug1txhtUks/mqE9wbP+tjxJLnJGtuBepve74hbiW9RtFMDrc22Pr143w7Sfk= 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=AOXIyF2e; 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=1710771720; 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=xwNlozyVa9wCKfV2gAvZZNhZ5jeQ/QZALXvKTp7xRLg=; b=AOXIyF2eeT1qpeckPTxAdF22asW6/TNA14RPAs5kebuYtQKC3AaL+CPVd4Eum9y8RvJNzl 5dMKjQegWXruMREOE/UPo6p3TAOszUAa5yo2nt+uQ3AuDOeBA0YvNhIWu6Cl1CbikEYe2i E9sQsS5dRIcuWrPXqZ2gLVFKMkBZIgM= 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-433-PMNkGQMOMYiyTf9cUHnhqQ-1; Mon, 18 Mar 2024 10:21:57 -0400 X-MC-Unique: PMNkGQMOMYiyTf9cUHnhqQ-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 AEEC185A58C; Mon, 18 Mar 2024 14:21:56 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 329C1492BC4; Mon, 18 Mar 2024 14:21:52 +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 2/6] x86: remove memblock_find_dma_reserve() Date: Mon, 18 Mar 2024 22:21:34 +0800 Message-ID: <20240318142138.783350-3-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 This is not needed any more. Signed-off-by: Baoquan He --- arch/x86/include/asm/pgtable.h | 1 - arch/x86/kernel/setup.c | 2 -- arch/x86/mm/init.c | 45 ---------------------------------- 3 files changed, 48 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 315535ffb258..cefc7a84f7a4 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1200,7 +1200,6 @@ static inline int pgd_none(pgd_t pgd) extern int direct_gbpages; void init_mem_mapping(void); void early_alloc_pgt_buf(void); -extern void memblock_find_dma_reserve(void); void __init poking_init(void); unsigned long init_memory_mapping(unsigned long start, unsigned long end, pgprot_t prot); diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3e1e96efadfe..5aa00938051f 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1106,8 +1106,6 @@ void __init setup_arch(char **cmdline_p) */ arch_reserve_crashkernel(); - memblock_find_dma_reserve(); - if (!early_xdbc_setup_hardware()) early_xdbc_register_console(); diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 5209549e8192..615f0bf4bda6 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -990,51 +990,6 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) } #endif -/* - * Calculate the precise size of the DMA zone (first 16 MB of RAM), - * and pass it to the MM layer - to help it set zone watermarks more - * accurately. - * - * Done on 64-bit systems only for the time being, although 32-bit systems - * might benefit from this as well. - */ -void __init memblock_find_dma_reserve(void) -{ -#ifdef CONFIG_X86_64 - u64 nr_pages = 0, nr_free_pages = 0; - unsigned long start_pfn, end_pfn; - phys_addr_t start_addr, end_addr; - int i; - u64 u; - - /* - * Iterate over all memory ranges (free and reserved ones alike), - * to calculate the total number of pages in the first 16 MB of RAM: - */ - nr_pages = 0; - for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) { - start_pfn = min(start_pfn, MAX_DMA_PFN); - end_pfn = min(end_pfn, MAX_DMA_PFN); - - nr_pages += end_pfn - start_pfn; - } - - /* - * Iterate over free memory ranges to calculate the number of free - * pages in the DMA zone, while not counting potential partial - * pages at the beginning or the end of the range: - */ - nr_free_pages = 0; - for_each_free_mem_range(u, NUMA_NO_NODE, MEMBLOCK_NONE, &start_addr, &end_addr, NULL) { - start_pfn = min_t(unsigned long, PFN_UP(start_addr), MAX_DMA_PFN); - end_pfn = min_t(unsigned long, PFN_DOWN(end_addr), MAX_DMA_PFN); - - if (start_pfn < end_pfn) - nr_free_pages += end_pfn - start_pfn; - } -#endif -} - void __init zone_sizes_init(void) { unsigned long max_zone_pfns[MAX_NR_ZONES]; -- 2.41.0