Message ID | 20250129224157.2046079-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 62260C02193 for <linux-mm@archiver.kernel.org>; Wed, 29 Jan 2025 22:42:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6FBA280098; Wed, 29 Jan 2025 17:42:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF31028008C; Wed, 29 Jan 2025 17:42:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF5A8280098; Wed, 29 Jan 2025 17:42:31 -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 90E5528008C for <linux-mm@kvack.org>; Wed, 29 Jan 2025 17:42:31 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 519611C7033 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:31 +0000 (UTC) X-FDA: 83061964902.23.99476D5 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf15.hostedemail.com (Postfix) with ESMTP id 79CCCA000B for <linux-mm@kvack.org>; Wed, 29 Jan 2025 22:42:29 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SVo6spu2; spf=pass (imf15.hostedemail.com: domain of 31K6aZwQKCN8GWEMHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--fvdl.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=31K6aZwQKCN8GWEMHPPHMF.DPNMJOVY-NNLWBDL.PSH@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=1738190549; 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=Wwa6fsXZRK5gAo5OnSYVBrwDMxNqaUw9sa9Xi3hrPeg=; b=2VKp5vfw+JS9vZs/505L68g8uNjDlbWh4rwXqLM71K60UvrOuAORDRoaeCtBqHYDb5axTk cjWJ9lqSKemlPtE9PYev+6B4nXjs+yx67qHuyvsarFDchHfh0k0KvuuF/ndbFZmpgyFt3M 4w7Ja4Onp6E+BKZbzVeXBgmCKXpvEXU= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=SVo6spu2; spf=pass (imf15.hostedemail.com: domain of 31K6aZwQKCN8GWEMHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--fvdl.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=31K6aZwQKCN8GWEMHPPHMF.DPNMJOVY-NNLWBDL.PSH@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738190549; a=rsa-sha256; cv=none; b=osIDVSUTFqYA/s3ej1qNUuGkW5kB93B3vNwYpLE+7U0ADhUcxwXoybk4Llav+ROZQSIPLN OlLM/UWNqj8W9LatXP9CkbZSu2cWTE4/81FK/PFLNO8ts+LxfP09JBE5SJf/uNNmLuXWuM GwM6H035HnxMrgTbQzzU+tfyppJCzI4= Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2ef114d8346so263381a91.0 for <linux-mm@kvack.org>; Wed, 29 Jan 2025 14:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738190548; x=1738795348; 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=Wwa6fsXZRK5gAo5OnSYVBrwDMxNqaUw9sa9Xi3hrPeg=; b=SVo6spu2MUgWfSuOUBuNuor7rMqY0pnUvBQwikcsgi3v2OTtwhQcL/kqiNV3v/O5Tq GOZtoIlOJ43JzjG3UfxX/2rzStuLvTx8AeDuojAVISBSGrEczml1S85S+qbo+zsU4RA2 LDIJF2wu/tYsdnMVDUjUJQC0aiy9j+z2NtBFSs7rLeUZJ+uscagipiFreWBtydFf1pS/ GiCsjsJQeL/EzgtLcBBvCnF/zDMtWjhxivZU/KYdEfnQdLnBufJSkwC04RA25zHPf+8W e41Bc5fmQFTFheRWcfWmYEL0cITE8sLrCj0x7FLyINm6TbFS4jImPM2e23x3F5fB4ZY1 Etyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738190548; x=1738795348; 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=Wwa6fsXZRK5gAo5OnSYVBrwDMxNqaUw9sa9Xi3hrPeg=; b=J9BHSQvlSJIvODgAWj+pnUT1z+mVuwMfSG/klwh6HApsfkMAmBtWcUuUGxL9s5eO71 u3sGdE9YDGrxrXmJP0R0GNtSEkePLMCfI2SBT7/uFR7nmueF6LTEMm5FOm+wbH194VGu h5S2Xfu2jxKFTu5WDb3luE3Neh2aOyBBmaDng3fLsw/R3c8oiQfL5mDWBbhBP1zO7U0i nTVNBQjLAuID613TqWBx56cgZOE3c9k2gCfZ4L43OWva0J3kvG/gQJMrVINChi0nhKkD xByE0L4oCAUQIEBNHUhXEtSAzemzdSvpgwjWZJ7ZZcWnwU/RFJgVI2h2zPTXHxWrVe4x T4Qg== X-Forwarded-Encrypted: i=1; AJvYcCXT0QhDrFNIxJDkNzZ6NTGPdd7rqUzFohhuJdhzFfbsE8RQZE89OfiioW8H7GvNMnkWEA1lWg4GQA==@kvack.org X-Gm-Message-State: AOJu0YylqRHBexbh+oGexy07aL+zI4rVI0IonLcTDx+D3GJOFm4Zkey6 Jhl5sKzqo7RmqSiUvRx6Uvb/d6wTh1W0/hDYlBXLmo8cl3tyLU327hYaL2eXYjGw15gBHg== X-Google-Smtp-Source: AGHT+IF59vnW7g2LrX0k3OPFChcYieeAbAKwK+MeTYrxX422BkPNegPy+HquNkgn402HeoagQo0/5oe0 X-Received: from pfbcn10.prod.google.com ([2002:a05:6a00:340a:b0:728:e76c:253f]) (user=fvdl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:2e88:b0:725:df1a:288 with SMTP id d2e1a72fcca58-72fd0c74f49mr8427084b3a.24.1738190548297; Wed, 29 Jan 2025 14:42:28 -0800 (PST) Date: Wed, 29 Jan 2025 22:41:36 +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-8-fvdl@google.com> Subject: [PATCH v2 07/28] 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, 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: rspam05 X-Rspamd-Queue-Id: 79CCCA000B X-Stat-Signature: o7tyce544u9g6in3sxwcj8ynjsts1cyj X-Rspam-User: X-HE-Tag: 1738190549-694424 X-HE-Meta: U2FsdGVkX1/Su1iChWOxyIpdGZGuhPQeBYAAlZZM7fF6v7Kd2UOynZuCaBXnGN9XWBNXR6RXHALCf5pk6sKkBL7NnnlpDaQrS2IIrx2n/9w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nGKFkxr/w8LdZvomnEpQxToHCzIrJipd6VXLBT6LwQFUS57Tg+M1ye3bUYyTnuQ16EiKXHBVto40QQT3fWtXP89991iuC3VN/NiYflsWDf9Y1Vg/e3wjoU6//doCgvMtGHd7yxg1vz3cBtiAvXL3xGZiflhN7MK5ZfI93MnXzoFsI35HCnYOiDhp3ThsatKTGKMDfPgPZIm4A1K6gIaYQEmzPoVYvO4DriHTnQ2wq4jwG076c7kCTI3K377q5Y7pZXrcu8cseedm2U/tcaqll9hyRyZRSlnklNSXdjpC59TUNRpgF+RQgXZNp7wTsm8+2otBUKwQeLXi7Pyk+Rz3Q9pXPGNAg== 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 196359254cfb..20d54eaf2bad 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(-)