Message ID | 20250127232207.3888640-8-fvdl@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 EE2F5C02188 for <linux-mm@archiver.kernel.org>; Mon, 27 Jan 2025 23:22:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA1F128012F; Mon, 27 Jan 2025 18:22:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C534728011F; Mon, 27 Jan 2025 18:22:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF29E28012F; Mon, 27 Jan 2025 18:22:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8CD8D28011F for <linux-mm@kvack.org>; Mon, 27 Jan 2025 18:22:38 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 42A98A0884 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 23:22:38 +0000 (UTC) X-FDA: 83054808396.04.13915DF Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf12.hostedemail.com (Postfix) with ESMTP id 6E51540005 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 23:22:36 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mWSuWn8Q; spf=pass (imf12.hostedemail.com: domain of 3OxWYZwQKCAop5nvqyyqvo.mywvsx47-wwu5kmu.y1q@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3OxWYZwQKCAop5nvqyyqvo.mywvsx47-wwu5kmu.y1q@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738020156; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Brcq4JfPtIrbpkUFa9/+gtrrIFaN0auRSXJvK1RMs+A=; b=6tNU2KVRZXU5wOdedsfU5LGfEJ822FA+hIioo/R767PpHA0dVeZUcz1IKOE6jdWpjpSOMy asnIJQG3xvnLEYpwz6IIWRXF4/ABSzwARAC7DMt8HHgvz7ImFVzU20gYtJp8ODs4rvWNux Cgk1ecKKqcAnPofkmiYz69KeitDt0Bk= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mWSuWn8Q; spf=pass (imf12.hostedemail.com: domain of 3OxWYZwQKCAop5nvqyyqvo.mywvsx47-wwu5kmu.y1q@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3OxWYZwQKCAop5nvqyyqvo.mywvsx47-wwu5kmu.y1q@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738020156; a=rsa-sha256; cv=none; b=VOMxNCeoUpNPHy6eoY360WCjcZF4MIzU288DrgN6v8Akn3klsCEmSKFpl1otDEj9j1Bgbu WYVggOuwzqes0OyZUjNnHUm4jgUw8fDJ5NAMkL53pbXSS0g+g8y4s322aPt1FZW6NYqRzR J2FyZ9JDxBu3VYDLm9x5AWEJYbGbdx8= Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2f2a9f056a8so9959106a91.2 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 15:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738020155; x=1738624955; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Brcq4JfPtIrbpkUFa9/+gtrrIFaN0auRSXJvK1RMs+A=; b=mWSuWn8QcUvRo5rDVnYfPjL9TJhhTJa96AZvu0qOIBUZTkmtO6pxBPN97BkRHLyjZ9 crGyRkjRO3pc0++4f2q+Nar67JBmMAbepsvqq6qF8PxONMoCYMz25TfmHi+frf0K1wv3 WEyENsUjWa82CC2rOQdYPB6ukczCHTKcJ1OIP6j0e4CWZVB8WjZer60iFF7ObCrcroTF st+7R6FkXKSvXey4wjBCUabz7pGLdN3eodQO9tTCw2PdyxZsQtNRSKNM59d7fSFaAf8I pEiGRgCxoO/IS/1Ec+8YhYokscL22xw1NgjH/2rd7IXdR8cy2w5EcBOCwimkZ8OVCWLG thPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738020155; x=1738624955; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Brcq4JfPtIrbpkUFa9/+gtrrIFaN0auRSXJvK1RMs+A=; b=UN/IEFxIIE0paqJtxlLd4lv5ZBnr/bocP9+mU5FeucMqcKxrIIyrI2CaHVpHaxFQ6E A291OX36ws63SdlS2dOywFDA8/5KJo3kimoa0EPDnSpAecBzOsWlMt7z4eG8JsBby3jn ceo2XeuHHWoKx+6HwLEAZlSipUpTvdHxVKlyA5NKrdUPARw8PqtM0VpNxJHzaiPFLmI4 j9LdvUHgCJdtbscI60dO06oGWYLpnAQNA3CbhPKNpW8ZTrqbs9Cti84q4ruyoe2FM2Ef FsXx1ossKidqjGjjp6sVEAWvmTeWoh5JpwVDR6IcBTbcOMegN2sc2BQCcWaINU7ENr9A aO3g== X-Forwarded-Encrypted: i=1; AJvYcCWAZaliL8DqbfdBgWDnVCXCYkbBQKEnCrZaIqgEJxkqPz/qFtDlLRrRkltrP8JyT5KSjPn5zyJGEw==@kvack.org X-Gm-Message-State: AOJu0YxrUvvtFVXXtvqaL8XTMazrlH1QonqalB9/vPE7hoSDNLCIbtdG a1JXKqHGsApYvmJLQ8E3wxRUVLD6rLFy2WyGRjNMaxbjYkySeAMdVndfvxHVCdq60QfmTw== X-Google-Smtp-Source: AGHT+IGUkjMGVlFTGDZ543aYzipvaZgJpL0AKG+8193aCJtZ1jd6maoDFhLCDJp+8UWj3sceamvMoeB3 X-Received: from pfbf7.prod.google.com ([2002:a05:6a00:ad87:b0:725:f376:f548]) (user=fvdl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:180e:b0:72a:a7a4:9b21 with SMTP id d2e1a72fcca58-72daf9ac293mr56912330b3a.5.1738020155273; Mon, 27 Jan 2025 15:22:35 -0800 (PST) Date: Mon, 27 Jan 2025 23:21:47 +0000 In-Reply-To: <20250127232207.3888640-1-fvdl@google.com> Mime-Version: 1.0 References: <20250127232207.3888640-1-fvdl@google.com> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250127232207.3888640-8-fvdl@google.com> Subject: [PATCH 07/27] mm/hugetlb: use online nodes for bootmem allocation From: Frank van der Linden <fvdl@google.com> To: akpm@linux-foundation.org, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: yuzhao@google.com, usama.arif@bytedance.com, joao.m.martins@oracle.com, roman.gushchin@linux.dev, Frank van der Linden <fvdl@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6E51540005 X-Stat-Signature: hia13nz4wwdjggezq6dbxh5a7q5tib6j X-Rspam-User: X-HE-Tag: 1738020156-88336 X-HE-Meta: U2FsdGVkX1+Hm8OYAVW47F6em9M/pRCJpnjFGDB85w5Qee4gJTHv8PfbWKFEC/mH/IXrwS3r4rwK7kCaaBvbKNesAkJsfAYd19SmORJihCrkEgmIRhaAma7HS5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vSBgiBw+kIUpReQsqCYMPGiklkFSa6Gi0rwLL8H1BefJ43gXxfX7iDdtiTJ/RKvEXHg2qdPiXArl5oIbvfd4cQwZoQZP1alY+J+xEjQkPY+ld5/SXp0Q9klhPhaMnOpzEdCgx0tLYuZs5xSlx7n/elb8Px056zpokv/k6BlL1Hdu5ctazvywMXqJA3t/LNRjLmh8LMxiVNBUsI3x2HV6WVQg08kVCBqoXRxk4zGvQU7moBKc1xvmaaElz6nSllbzZF3aNMIGf6fYFTlyFTd4Q12SdnMN2chKIdAChOEcVXJVgUPF1GyD7S6xDHrkBjZJaAtx1lGGvLJ+un4/h7GHkQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
hugetlb/CMA improvements for large systems
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 42d8334d13bb..a67339ca65b4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3152,7 +3152,7 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid) goto found; } /* allocate from next node when distributing huge pages */ - for_each_node_mask_to_alloc(&h->next_nid_to_alloc, nr_nodes, node, &node_states[N_MEMORY]) { + for_each_node_mask_to_alloc(&h->next_nid_to_alloc, nr_nodes, node, &node_states[N_ONLINE]) { m = memblock_alloc_try_nid_raw( huge_page_size(h), huge_page_size(h), 0, MEMBLOCK_ALLOC_ACCESSIBLE, node); @@ -4550,8 +4550,8 @@ void __init hugetlb_add_hstate(unsigned int order) for (i = 0; i < MAX_NUMNODES; ++i) INIT_LIST_HEAD(&h->hugepage_freelists[i]); INIT_LIST_HEAD(&h->hugepage_activelist); - h->next_nid_to_alloc = first_memory_node; - h->next_nid_to_free = first_memory_node; + h->next_nid_to_alloc = first_online_node; + h->next_nid_to_free = first_online_node; snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB", huge_page_size(h)/SZ_1K);
Later commits will move hugetlb bootmem allocation to earlier in init, when N_MEMORY has not yet been set on nodes. Use online nodes instead. At most, this wastes just a few cycles once during boot (and most likely none). Signed-off-by: Frank van der Linden <fvdl@google.com> --- mm/hugetlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)