Message ID | 20250129224157.2046079-18-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 609E5C02193 for <linux-mm@archiver.kernel.org>; Wed, 29 Jan 2025 22:43:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 541E62800A9; Wed, 29 Jan 2025 17:42:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CF4728008C; Wed, 29 Jan 2025 17:42:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F79F2800A9; Wed, 29 Jan 2025 17:42:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0C8AA28008C for <linux-mm@kvack.org>; Wed, 29 Jan 2025 17:42:47 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C75DFA04DF for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:46 +0000 (UTC) X-FDA: 83061965532.24.15D25A5 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf06.hostedemail.com (Postfix) with ESMTP id F3A78180007 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:44 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="mnztq/dM"; spf=pass (imf06.hostedemail.com: domain of 3466aZwQKCO4VlTbWeeWbU.SecbYdkn-ccalQSa.ehW@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3466aZwQKCO4VlTbWeeWbU.SecbYdkn-ccalQSa.ehW@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=1738190565; 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=owdlgfr/VPS42Eha44p1LufvQJZlV8Uk+cba5IVjd9o=; b=2ZJoCeTEbl2qUvYoohO5JFyljHz0Yi2cX4u56jTvfnb7mqi/t7ArkA98AJmVmWdzCXJkMy 42rDtZMgkbjpDlYjjuns/DPEhmMzxzFLTQQx0vW0FErFLERmBTUGEmUQDQsFLJmvZvUt4Z t0p+hvhlZEQsgMFjlJGrJlUs9t0LNaU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="mnztq/dM"; spf=pass (imf06.hostedemail.com: domain of 3466aZwQKCO4VlTbWeeWbU.SecbYdkn-ccalQSa.ehW@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3466aZwQKCO4VlTbWeeWbU.SecbYdkn-ccalQSa.ehW@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738190565; a=rsa-sha256; cv=none; b=Vbzc0vLxVA0BsJNhfOculu2NfJqEXleq9vyncBnRw+dWofpYvuF1OYdhA3zHc5n+UJA78U P84R0j0G5ScEhbLbhG4qvEnvd0U4PSeE+otdcXd/GERsp2uH4+Ohyb/fvsKmd35it9EVN+ WwJBljFcy6sJumdHvESrYmGWDfupDvI= Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ee3206466aso2409824a91.1 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 14:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738190564; x=1738795364; 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=owdlgfr/VPS42Eha44p1LufvQJZlV8Uk+cba5IVjd9o=; b=mnztq/dMxUNljGjAB4gbNVQ7TMWChXGjNRyIXTKztipWaynPSoDSHgqSfhW26tb6eT NfVrran2xj5AMp05bIp7P8sMB6XipfwcxRD9SmnTf4LLjx1TV0HZSyd1J87r0DW3+OSn F/Vbw5shs70IPu2TgY1wsGn5SdusJxaZbpmRJSXx4OGLynFe1J6Sm972dlSHuoeqajb3 uuUBAKt190TDVqnSRihOHj+1oPi/nf9JYoJHUUZIwXqCD88RdT28eGB/qiqW4NRWYIzR XQk4njoA16TbeYbhYtnLKeTJ9UUwnN9F3m3tJlc3JEv9WKcHcmTd/OcB3BkkOPK9oOy0 oyaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738190564; x=1738795364; 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=owdlgfr/VPS42Eha44p1LufvQJZlV8Uk+cba5IVjd9o=; b=PEi1Qb8Ad96SJ2H1DtRYFXgheAgkLHmj8PeMeC0dD3ZiIgl/Ic4JjO8BQ3OihKFtaV tn1RCvjQm2UJl9NspCsAW9UIc4iK74wuxwPHuvR6ZDo72JGj/jUq9a94PYBSAGhGgFqY rhUSV3EkwgAh6etqjFHwp2GTcYb+E4t2CvXzNwAnZnLg3L2kngUFL210dsUswB222D7j raXYg9kRAd1CcMYBZ3KBojPVZL4hk2JE6YKpZmBRM6zj2G37rLq10ZP8Brt+iUkozbEo UaanOJOevPQ9Mba2WVH4H/pMH18TBHfhKHRfhDTpRNYG6yrY7PpR6oFTi32LSkqmyntZ a57A== X-Forwarded-Encrypted: i=1; AJvYcCUPws8yb4ag+N7YiFhIr1UgPOZu8VyGAjsUSTrPEDi7QSLGOuM6M767SluuPE+X0KFsXqogjT/tSQ==@kvack.org X-Gm-Message-State: AOJu0YyVamgMpYxCXQcqbarHhDqgkQ1+xZgXzi4zLjjCp8QYlRvJJhgW +chW0l7AyusQ6y8tYo3dCZpX+4SmmKzy3pHPBCGfnJ5OEY7siPRZNUgmu65Z9jI1F5vHEQ== X-Google-Smtp-Source: AGHT+IHEVdOPU8hWxfFhDQfhZQ8pAOtZCFOUBUvtqAFn5Pxdp3YDWz7gu5clrbq1G86WIUxTF3GKcBps X-Received: from pfbeg27.prod.google.com ([2002:a05:6a00:801b:b0:72a:89d4:9641]) (user=fvdl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:388:b0:725:d64c:f122 with SMTP id d2e1a72fcca58-72fe2ccbc83mr1635907b3a.2.1738190563842; Wed, 29 Jan 2025 14:42:43 -0800 (PST) Date: Wed, 29 Jan 2025 22:41:46 +0000 In-Reply-To: <20250129224157.2046079-1-fvdl@google.com> Mime-Version: 1.0 References: <20250129224157.2046079-1-fvdl@google.com> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250129224157.2046079-18-fvdl@google.com> Subject: [PATCH v2 17/28] mm/hugetlb: move huge_boot_pages list init to hugetlb_bootmem_alloc 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, usamaarif642@gmail.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: rspam07 X-Rspamd-Queue-Id: F3A78180007 X-Stat-Signature: fea4xbdg4gwc974strrxnpu7rzth5qre X-Rspam-User: X-HE-Tag: 1738190564-29951 X-HE-Meta: U2FsdGVkX1+s5gs4QYpBlZCbk3hN40d0tdopHTIkT0HN77cRhaPYXyiLjiFj9SM2rRl+MBB58aT/fKzzOBfgWPcr0OF2nyqHCERf3NtLFGko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Ig2FZ6lEGdBC/y7CIvleKBKOeBaVNYNMOsukJFbvyZEaSZeXovwzDZBQq6xhGbQmyaXEl+raq4lKKf4OIwU5soYC4wgErA0zY+pLFbj9QX7sH0aeVwPpRSlX48dehuxNW+38p78Oftnrh5a77pnQyEYDdeHN31lTkohjX/C9p30KMLQKw5HvV5N3ZdtuSpRJF76w96Tkhr2ST5v9e141n+PmEZJWDohiDoZrKWzix5CJoVCLSj/h5JBy+yPFXHJZPR7OXLOW9DlCShbV8yLcY/8mxeOPtUMs2NPfPDcSK1WZcsI5uC8RUPLOxgtavB2iXoHuQD5Gf9po5Vm7hT/0drjHw0lZAL0vPLTeszKxrG9e3O5o7gCFX7/ff6DV28ZiqwG16a2Kppslwjlu057DXF0jA5/iHPGzhA/U= 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 0a27659d9290..7879e772c0d9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3579,7 +3579,6 @@ static unsigned long __init hugetlb_pages_alloc_boot(struct hstate *h) static void __init hugetlb_hstate_alloc_pages(struct hstate *h) { unsigned long allocated; - static bool initialized __initdata; /* skip gigantic hugepages allocation if hugetlb_cma enabled */ if (hstate_is_gigantic(h) && hugetlb_cma_size) { @@ -3587,17 +3586,6 @@ static void __init hugetlb_hstate_alloc_pages(struct hstate *h) return; } - /* hugetlb_hstate_alloc_pages will be called many times, initialize huge_boot_pages once */ - if (!initialized) { - int i = 0; - - for (i = 0; i < MAX_NUMNODES; i++) - INIT_LIST_HEAD(&huge_boot_pages[i]); - h->next_nid_to_alloc = first_online_node; - h->next_nid_to_free = first_online_node; - initialized = true; - } - /* do node specific alloc */ if (hugetlb_hstate_alloc_pages_specific_nodes(h)) return; @@ -4921,13 +4909,20 @@ bool __init hugetlb_bootmem_allocated(void) void __init hugetlb_bootmem_alloc(void) { struct hstate *h; + int i; if (__hugetlb_bootmem_allocated) return; + for (i = 0; i < MAX_NUMNODES; i++) + INIT_LIST_HEAD(&huge_boot_pages[i]); + hugetlb_parse_params(); for_each_hstate(h) { + h->next_nid_to_alloc = first_online_node; + h->next_nid_to_free = first_online_node; + if (hstate_is_gigantic(h)) hugetlb_hstate_alloc_pages(h); }
Instead of initializing the per-node hugetlb bootmem pages list from the alloc function, we can now do it in a somewhat cleaner way, since there is an explicit hugetlb_bootmem_alloc function. Initialize the lists there. Signed-off-by: Frank van der Linden <fvdl@google.com> --- mm/hugetlb.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)