Message ID | 20250129224157.2046079-6-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 2D7C3C02190 for <linux-mm@archiver.kernel.org>; Wed, 29 Jan 2025 22:42:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8523C28008E; Wed, 29 Jan 2025 17:42:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7612528008C; Wed, 29 Jan 2025 17:42:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E0D628008E; Wed, 29 Jan 2025 17:42:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 27D0028008C for <linux-mm@kvack.org>; Wed, 29 Jan 2025 17:42:28 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DCBC61604B4 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:27 +0000 (UTC) X-FDA: 83061964734.27.AE125A0 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf07.hostedemail.com (Postfix) with ESMTP id 2149040009 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:25 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=z+CBmFN0; spf=pass (imf07.hostedemail.com: domain of 30K6aZwQKCNsCSAIDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--fvdl.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=30K6aZwQKCNsCSAIDLLDIB.9LJIFKRU-JJHS79H.LOD@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=1738190546; 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=pO0e6xegNdeyhYt32o5iXhR2JH8dHRA9GoUIxGwwPLE=; b=8NAzQFU2rdcfDQ9pzNHAYG0s3RdmqzJoTs10wghUutoQIpLpVmBTc3kxIVGTG7A1tXs/il REcvZXNxpLR1b5bjmy/kbvrj86mpycdE2+h+JSMwbnGk9H4BrtoxFwnTzYLwJyj9TN3pic THLMNpHiS8E8zemM/XAF2Cp/tQy/X5Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738190546; a=rsa-sha256; cv=none; b=48LNJckx6mC/R2XkEmf5ZyZu0kRAf8bf/9lCl9TBOIlN9mbg40UfcneQovQD1SgzVmNCv1 NFqlXwWyKGjhJE4bfhd3IpK+xnzdOVHgcZTFHfi613TJIda+fFYOd5YHdUVs9tZ62ej6a9 y6NRAEki2+DEq3QcTTdYuI4NSiFMxeQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=z+CBmFN0; spf=pass (imf07.hostedemail.com: domain of 30K6aZwQKCNsCSAIDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--fvdl.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=30K6aZwQKCNsCSAIDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-216387ddda8so3060455ad.3 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 14:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738190545; x=1738795345; 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=pO0e6xegNdeyhYt32o5iXhR2JH8dHRA9GoUIxGwwPLE=; b=z+CBmFN0Bjt0x2b9DDqT6mKUl/slHJ28PMjzGQZzl2zsyFxZDHvxcDhde4GUDNpN6x CTUmH+zWxk2PjaDPDBFzjwzVlaGQbLcPDzwdynH0P/ORtlQ54HgODgzxBfj3CHqvfeQf UR7OBChhRQO7Vf8rLmrtQkMug+wydfztvtP9PKYY6+KIXJzjzo4i88A640bB/wnF93b3 2OyI0fsHf33+m2s0ODERebvqfQEK1UC9k09xbY07GDcPi/gW79WF04dNqCSoRnJ8a1CY hpY8Czk6m2FFsgfcxlthxyWiM35dzmozr4h5z37hKuv8Zqkz9lPmtQjGAoZZkJYYHeXS aD0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738190545; x=1738795345; 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=pO0e6xegNdeyhYt32o5iXhR2JH8dHRA9GoUIxGwwPLE=; b=G81EelnjJkOvMRGyP7MfOtJLR4mFdjB6A1qVjHHDF5+jihjYLSd4rVwVFqmTi4VlOR oc4qCH6emphS8HuMW/oXNeKBvBqt5TXKvblAl1D3j7SOYXRuaXrIMxTo8xtTC3mJ0rPi M/OO3Mx60kmMvvqwherytq4/0lrw0EZaEDALEbMfa9EAxnGHTohQuPAS1sAdB3mWJpI9 2pxpXx6bbGMgR2UV8YM/G7xXNRIdE9gKp57rtUR/nkF0BLkVjvOe/hD+nyJX/4HovC9U 28Cn6dmi/hL+MJb1kfoqQKjG5F1k1AU8uA7f2Rm/0/PlS1KBHgtyIrDp0cWauCSkOI7L OrDA== X-Forwarded-Encrypted: i=1; AJvYcCWOTm3MEWdRY0sU9DEUCxQfiAcVw82uEeoV1T1L0Zpgoj6ojSeBQPIsd6xXAWmfr6miqjP7jVtBZA==@kvack.org X-Gm-Message-State: AOJu0YzUkka8HKVoFYltHFzYOI+D2sPFlSIsAHQY/uRcI6gbkI+6Pnaj PenKfZ92NpgWod1xI+EeR1KHO5CoydlC25DighqOF4LVCJVjxDqvCkOq5bdEeCQVUB48MA== X-Google-Smtp-Source: AGHT+IFwoboaFCPCNze444ZM4fyXAd+gC8WqzGJgwGWoda0w7P4FTxdLEGdWCLzLUoUhT0C9JBl48K6X X-Received: from pfwz40.prod.google.com ([2002:a05:6a00:1da8:b0:725:df7a:f4e3]) (user=fvdl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6d99:b0:1e1:b8bf:8e80 with SMTP id adf61e73a8af0-1ed7a6e16f2mr7506593637.41.1738190544972; Wed, 29 Jan 2025 14:42:24 -0800 (PST) Date: Wed, 29 Jan 2025 22:41:34 +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-6-fvdl@google.com> Subject: [PATCH v2 05/28] mm/hugetlb: fix round-robin 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, usamaarif642@gmail.com, joao.m.martins@oracle.com, roman.gushchin@linux.dev, Frank van der Linden <fvdl@google.com>, Zhenguo Yao <yaozhenguo1@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2149040009 X-Stat-Signature: 8on3jb68tatz18qwkb7dr4urd5r47511 X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1738190545-393745 X-HE-Meta: U2FsdGVkX188f9UTWDm86QXBkeqTG32/a/sGNjPAiw7vkW3AYue4+F2Bqp+MXh4/hfV6oldUEyGabgxNj5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VdG6+TeUR9p2zA/7a2P/S+AwFzQ0zGBfintsr7n1lg/PJAgjk8qqmfmNJiWOkSAmqFGgrpGrbkBhi9LnayoWtYZ5MRxsR5WZ7u+PzPX+VbocoIpnqQ7KkI+gsZplDeN8ftXez38jLRKb23Vp67Sgl+38f2Zjia4jJwEdpL2n8Ij7W1O34QN2SpP/GxcxKyTat25V8Qt1rdyrheZ13HeZgq3QesiotshuvbJvkMWwq+npIq6deq7/pkYp10qYI+pc4MHoNtYqGjxqcmYPVdf71Sl70FgXLBwbEFizbacKUcLv4CgJl+zckPQd1PXlpeaN9HW0uFpmRse6Tti+3wGbCm+Ax7zO6803iv6CVkwjnYJDEfFsYqepVu8hOtwltA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000049, 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 bc8af09a3105..18d308d5df6d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3156,16 +3156,13 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid) m = memblock_alloc_try_nid_raw( huge_page_size(h), huge_page_size(h), 0, MEMBLOCK_ALLOC_ACCESSIBLE, node); - /* - * Use the beginning of the huge page to store the - * huge_bootmem_page struct (until gather_bootmem - * puts them into the mem_map). - */ - if (!m) - return 0; - goto found; + if (m) + break; } + if (!m) + return 0; + found: /* @@ -3177,7 +3174,14 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid) */ memblock_reserved_mark_noinit(virt_to_phys((void *)m + PAGE_SIZE), huge_page_size(h) - PAGE_SIZE); - /* Put them into a private list first because mem_map is not up yet */ + /* + * Use the beginning of the huge page to store the + * huge_bootmem_page struct (until gather_bootmem + * puts them into the mem_map). + * + * Put them into a private list first because mem_map + * is not up yet. + */ INIT_LIST_HEAD(&m->list); list_add(&m->list, &huge_boot_pages[node]); m->hstate = h;
Commit b5389086ad7b ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") changed the NUMA_NO_NODE round-robin allocation behavior in case of a failure to allocate from one NUMA node. The code originally moved on to the next node to try again, but now it immediately breaks out of the loop. Restore the original behavior. Fixes: b5389086ad7b ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") Cc: Zhenguo Yao <yaozhenguo1@gmail.com> Signed-off-by: Frank van der Linden <fvdl@google.com> --- mm/hugetlb.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)