Message ID | 20250127232207.3888640-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 157B6C02188 for <linux-mm@archiver.kernel.org>; Mon, 27 Jan 2025 23:22:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9205628012D; Mon, 27 Jan 2025 18:22:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CFFF28011F; Mon, 27 Jan 2025 18:22:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7487528012D; Mon, 27 Jan 2025 18:22:35 -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 54E4028011F for <linux-mm@kvack.org>; Mon, 27 Jan 2025 18:22:35 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0E2C21207E9 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 23:22:35 +0000 (UTC) X-FDA: 83054808270.14.D264426 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf27.hostedemail.com (Postfix) with ESMTP id 2FCCC40010 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 23:22:32 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=NKK9Mv+l; spf=pass (imf27.hostedemail.com: domain of 3OBWYZwQKCAcm2ksnvvnsl.jvtspu14-ttr2hjr.vyn@flex--fvdl.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3OBWYZwQKCAcm2ksnvvnsl.jvtspu14-ttr2hjr.vyn@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=1738020153; 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=3cL+TUH11/smaxLgrRBkwnVa/XBTlyU3EXvG7o/S9Vk=; b=poYdMNEqcQ9UTn1xvn8Gyqk116LoMiU0qGftDmcYqNLclVQdb+U/ds+wIolfmWpDddTwn1 Ht9QP3201IEbX6f5yGgDbvHv0B5VbF9vd1Uydt7jxWtYCMRBcuyTAkk6zcvuU8q7/qugB8 YNVad13LbrzSwn239DI3M/H+D3gJZlg= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=NKK9Mv+l; spf=pass (imf27.hostedemail.com: domain of 3OBWYZwQKCAcm2ksnvvnsl.jvtspu14-ttr2hjr.vyn@flex--fvdl.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=3OBWYZwQKCAcm2ksnvvnsl.jvtspu14-ttr2hjr.vyn@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738020153; a=rsa-sha256; cv=none; b=TCH2N7EOD9xL2D58C7nKK2Vj+ThSCF4dA6J/TwhvihnT1To20pQG6xtw6FU+X7uMF586sO MIy1OQZR6/N1iZcLOp37l5Dnli0MTBS04ml5HUn1ePUACjzCM1+8WI7k4Rb6Ux4v8yoPPs SW4lvOnimWMPNOu0jMUd7C7kQ9euW90= Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ef7fbd99a6so9590954a91.1 for <linux-mm@kvack.org>; Mon, 27 Jan 2025 15:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738020152; x=1738624952; 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=3cL+TUH11/smaxLgrRBkwnVa/XBTlyU3EXvG7o/S9Vk=; b=NKK9Mv+loF7aUwbTin7z3mAdpmg2YNTGrdu1Sw98+Byui0qoj/MlbIFUhoaNvbS9TA F3RikNo2l+qcOSjS8V6sDIylDUDQs7kNw7i/rwdq6H9fmmcrMH43GAyD0RyevBPZeyyn 8ws60u1nwY+676vu23G7nMUuUKM6j4Ywt3gcHRqeNopb0P1hJD5VWe90e+BMVFf65f32 dlsNkIcPEPrDTYW+V9sSogLTma2labCET4Qp4IyP1I0CahRpzwknHAhb2n9TsXC6aNsZ 6CylnWV7LIrqysymxvCOZp62jz3EQwy+Yv1Zo/754bO8sZmGAn7S2V7Rwb7xj9vINrnT Tjcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738020152; x=1738624952; 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=3cL+TUH11/smaxLgrRBkwnVa/XBTlyU3EXvG7o/S9Vk=; b=eWazh2huBG8EguW6fejWhX3XGLxghmWLdZajd2rN13P6EdwLDeCwWXyyRJ7dsFyRNk JAzaRouyOYZK5UnLB3NO6XzTj3cm3Glk5eRNW0QaxJSQ9PYMZbJzOQtYFYm6MaYwST9Y TmPbx6V5FTxi/1tWiKlbxbUI4anLNbSZsO2ivIou4ZbGxOtLnOn8y/ZmGD/4j7L2AFbi zXgknRNooQL8eqp1mDKHcVw7MuAOOPPevKUJMS6LzzJRY3GbveOa+DKbuGFBw0nsM37r N8s+m8PCgAfDzcm7zkE/Lfb8JeoU4NpolVnZijr7r/K80ajtUpDKi4WFhrRxY//RaH+q pQ6g== X-Forwarded-Encrypted: i=1; AJvYcCWNq65sJJ+PCs2+KNSvDy6l0TWBdX/D4ULRxothcFRxT1J+oICVWfUyPxJtWl7hbSopvkXw2aQS1Q==@kvack.org X-Gm-Message-State: AOJu0YyLk5yp1FT0hj94EXLspZhEaTFfy3Ovkv4rqDkyAQN5sEWGYW8k 9L/b4o6f+LFG5HIfkSzarpRsHGuDkJV3iHE7XUc7Q/9G2kWAdomDWR4jbzeTNEi7xqoLLA== X-Google-Smtp-Source: AGHT+IGgN6UDyZ6CnhbCZLqRUCN/vH+l2DkjmSnZAo2yRRKakYvM4vMlM8AITyVlOysWw5h6u6wtZxFn X-Received: from pfbbd41.prod.google.com ([2002:a05:6a00:27a9:b0:725:e05b:5150]) (user=fvdl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:21ca:b0:727:3fd5:b530 with SMTP id d2e1a72fcca58-72dafb36d75mr57071331b3a.15.1738020152104; Mon, 27 Jan 2025 15:22:32 -0800 (PST) Date: Mon, 27 Jan 2025 23:21:45 +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-6-fvdl@google.com> Subject: [PATCH 05/27] 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, usama.arif@bytedance.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-Server: rspam07 X-Rspamd-Queue-Id: 2FCCC40010 X-Stat-Signature: 66sxiet6amz8ruc6dieb8cm15ft74x8e X-Rspam-User: X-HE-Tag: 1738020152-188395 X-HE-Meta: U2FsdGVkX1+WnsUIeSZ8+pUzwUY+M/Xj7DBYeYlD1t6dll5KnSWwWpNTPbjt3rGSgl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wd0d5uDFq+Ij3m6YFPFAXT1Lod8zAeG9QwhcjvVP+mLFD1TZ95/aGsGfzFu0WYTGyfeLdvUQ4nhgtpwNIdaouWMPytsV5PuZxHzo3Y/BZnATRcmliRhfYo91gy83tqvJsV3C5qZeAACAptqnhyLta3dQs81rKAzOE17+9F0NGijIarWmhy37lUugBkCImsa4CcsPphG7wqBBbGoIyj4Y1GNT5hBD2ZSU+5U+QHpqSnlXV0EOIgwNWKjdozpOqkrDBMyjVH5gd+LU6VZuRfsRDpLC1h+7/YJi6TSlBPbIkwwOXtP2N9fkgCGicFDHPft/BqSsweXhhMIdIYbdBvZC01cPNs8ABo63gE3nUYY9oRl81ei4qilTbf3+JmUhQHh+lIFFYRmIt0esKq7P2tYXItFOA= 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 b187843e38fe..1441a3916b32 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(-)