Message ID | f8d8dad3a5471d284f54185f65d575a6aaab692b.1736592534.git.ritesh.list@gmail.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 0A5BEE7719A for <linux-mm@archiver.kernel.org>; Sat, 11 Jan 2025 11:07:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AE9F6B007B; Sat, 11 Jan 2025 06:07:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 35E686B0082; Sat, 11 Jan 2025 06:07:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 225BC6B0083; Sat, 11 Jan 2025 06:07:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0683E6B007B for <linux-mm@kvack.org>; Sat, 11 Jan 2025 06:07:15 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A4B1F161230 for <linux-mm@kvack.org>; Sat, 11 Jan 2025 11:07:15 +0000 (UTC) X-FDA: 82994894430.22.44DD4FD Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf16.hostedemail.com (Postfix) with ESMTP id E5DAE18000C for <linux-mm@kvack.org>; Sat, 11 Jan 2025 11:07:13 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=S05g3M5y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736593634; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=7dJBA567x3VSnef2WSdNeapyYrTf3AGBMw9CpoxpetA=; b=mRyLlL24tx1kA09e4ghFT8Ld2TMHITQFZcwHFzLBnd8xtGDcdgHwY6JzoLC6mfERUpMfZj cnawli0bXAXY6g3+90VArpsBRDR8rSHaFxlTq3P7qCBYd54wt59q9jEurj2jNj94iAl07M 7UobUH3NIUoRrQmM0iJkRhfC25GKHpA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736593634; a=rsa-sha256; cv=none; b=JMHbv61tBK1VOTA82Hm41FcJL05uWYxA2hSxAIObPDDTmJV37DlKUxZyQBBLyykcNGdeQ+ uxCMv0t8nzXG0Y4jlKFTHxBqSuKBRfGQmjZCScmAtFp4TuROaQER3W7JpPz9+6qKnV3gxt Wj1wkhL02lJAuuf8poz3gUscOaiDhFo= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=S05g3M5y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ritesh.list@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=ritesh.list@gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-21619108a6bso48714155ad.3 for <linux-mm@kvack.org>; Sat, 11 Jan 2025 03:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736593632; x=1737198432; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7dJBA567x3VSnef2WSdNeapyYrTf3AGBMw9CpoxpetA=; b=S05g3M5ybOmjycViZQB34Dl/mVjXFlSNg0ka0Hq73O+poLjfFTuZhMY6ajUDm1GjjD QuMG8/GAZyHqnCzB4GIlucvIpCDuXXgRadSgEnbclXJ46aCi1MkSvvV+wHW2Y0vs9q1Y lnqnUaynpU9PgW4PL2C78A+NughFSNpgjc4J/DevktI1d+bLFq8T2cSZYeyx2J9d2o9l 057k9GNW1u1X7eQm5GwjDs6rdUmN0Hga+iXnjzHvS5UuRzRjc835tw3zAV5mBCaIez+h dPNP/XJiTPjwPrEe0mwQzSAiNilrijLHFvHV43wQX/ikgEmPVQXz8TRLZz++4nyCt/5x vlLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736593632; x=1737198432; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7dJBA567x3VSnef2WSdNeapyYrTf3AGBMw9CpoxpetA=; b=hGwza92IYk7T23YVnrfOrgb3WWK4YKO9+pB4ey+gk6RA8sXaN7pQg5gzNpqKj566Xa nvHJ7l8vmCvaKf4QRsbv+KPdJ8qLEj3HexSm4/1nMWcZz9HA+VZPa41OC8svdCFBB5i6 VmIYEuze8ZziiZid8UoGAdN4paVuzXqmQpZTz+ARWWhITtE/qoMZDXtEBtrSnMe58q8c oLrLfw29XZQdF0ayFzxWIB6TNPFWJk7p+yN6hwggl3gq2bclGuGH8B8+5Nh16k4FHtTJ nFTonhplatwpGDsJyPT6myiagz7VoMhM2ynse5Q59t2KlRAXrk1rgTlsj9CaYKR2G+iG CxrA== X-Gm-Message-State: AOJu0YyX4Zqtlvuqwf2hPlWodOxZET/pr2U4oFxuAQcDO24a9SQfwNd1 GSO9k+5Eh9C+91jZASskjn13Ge96XYFk18IxZurk7uCMxyIoGQtCBAXMUVqNvqs= X-Gm-Gg: ASbGncuFUCFWUMahfTHQauW3Xk8QXxZsYo1hwKlEqWLKvCVS6VJszdoWAqTGN6AM2R0 iO/cqMXWCIHCSep+vSn/DUpX/FKK0SRZbu6w3r5CkLqIPgJo4KdfUYEy6ATR4T0Nqv/AnDwWT7A 7TshNlbPmxJ1kSXc/kcTEuiqpnwccAABpe29CJEzJph32oK+hAfHRLX9sxHPTmpikHpMw6RiodO UFv5oIvtqQ568JLxxaBz2K1zqntKifikY74qJ3R4lpeJAamFT+ykj7PfUV9/Q== X-Google-Smtp-Source: AGHT+IE71LIkRSS1GP9t/vOR+d5nRAPgsQDgTxxk1Sj3t+x3laNAZmRRB/il1U8FKiejMSvFyzmnRg== X-Received: by 2002:a17:902:d481:b0:212:6187:6a76 with SMTP id d9443c01a7336-21a83f4d7c8mr219534115ad.14.1736593632070; Sat, 11 Jan 2025 03:07:12 -0800 (PST) Received: from dw-tp.ibmuc.com ([171.76.81.42]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f217d77sm25967205ad.110.2025.01.11.03.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 03:07:11 -0800 (PST) From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com> To: linux-mm@kvack.org Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>, Donet Tom <donettom@linux.ibm.com>, Gang Li <gang.li@linux.dev>, Daniel Jordan <daniel.m.jordan@oracle.com>, Muchun Song <muchun.song@linux.dev>, David Rientjes <rientjes@google.com>, Sourabh Jain <sourabhjain@linux.ibm.com>, Pavithra Prakash <pavrampu@linux.ibm.com> Subject: [PATCH v2] mm/hugetlb: Fix hugepage allocation for interleaved memory nodes Date: Sat, 11 Jan 2025 16:36:55 +0530 Message-ID: <f8d8dad3a5471d284f54185f65d575a6aaab692b.1736592534.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: krh7g8j86y655q3psos7fjppdwprqg16 X-Rspamd-Queue-Id: E5DAE18000C X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736593633-985573 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uaQSy1ILU7X8fGiGehHE+u5ltWXnEHQN2mJGt+y9UJE0MmS49pjiOZv6wWNuw0St/NLR+d8Y/0p3FZbFZXXZLG3zxbLGC1dQIC1+7evBkrYGilwxFHsQM4wHLztle2ezEgaQFCWgn3pUk0rrp40XKLeavHyADqmICwXzwn3kDShnp3CUaDdkYMgBspjk9/Ic3MY60x9NdtmjwqFOBTzbNTxTq2nNdMdcfEl1X9442IwA1iClZHUMRiffdp8iqYGVM9fBe5YRPIWiWfJjZXmbRqk3vcXpZImYRkUT+x2hfmGFZhN7BDukseZW94xl5yAllrVJLGTHDYCe+PWCtaxFcDPf2ljzN3uf51wbWcZ85dikrxnUjDJeTQvFefIa5+p/gf0Xa0NWE/vRSLfE9RbnNUyYlfpc39nICAPJuCi4i/NdXAOYkRM+AAxpg+wrIw489S3ZtTVtZqBfh0mwFa5ehky/scyTZ/xHkyagpSCgbAd1YzcGYzjjSDpGynDTSKrj2SYUQAlWqexyHaop1svoRHye2VgzjBCm9V5AOLraf876CXz 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 |
[v2] mm/hugetlb: Fix hugepage allocation for interleaved memory nodes
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c498874a7170..4e2a1e907ec5 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3289,7 +3289,7 @@ static void __init gather_bootmem_prealloc(void) .thread_fn = gather_bootmem_prealloc_parallel, .fn_arg = NULL, .start = 0, - .size = num_node_state(N_MEMORY), + .size = nr_node_ids, .align = 1, .min_chunk = 1, .max_threads = num_node_state(N_MEMORY),
gather_bootmem_prealloc() function assumes the start nid as 0 and size as num_node_state(N_MEMORY). That means in case if memory attached numa nodes are interleaved, then gather_bootmem_prealloc_parallel() will fail to scan few of these nodes. Since memory attached numa nodes can be interleaved in any fashion, hence ensure that the current code checks for all numa node ids (.size = nr_node_ids). Let's still keep max_threads as N_MEMORY, so that it can distributes all nr_node_ids among the these many no. threads. e.g. qemu cmdline ======================== numa_cmd="-numa node,nodeid=1,memdev=mem1,cpus=2-3 -numa node,nodeid=0,cpus=0-1 -numa dist,src=0,dst=1,val=20" mem_cmd="-object memory-backend-ram,id=mem1,size=16G" w/o this patch for cmdline (default_hugepagesz=1GB hugepagesz=1GB hugepages=2): ========================== ~ # cat /proc/meminfo |grep -i huge AnonHugePages: 0 kB ShmemHugePages: 0 kB FileHugePages: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 1048576 kB Hugetlb: 0 kB with this patch for cmdline (default_hugepagesz=1GB hugepagesz=1GB hugepages=2): =========================== ~ # cat /proc/meminfo |grep -i huge AnonHugePages: 0 kB ShmemHugePages: 0 kB FileHugePages: 0 kB HugePages_Total: 2 HugePages_Free: 2 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 1048576 kB Hugetlb: 2097152 kB Fixes: b78b27d02930 ("hugetlb: parallelize 1G hugetlb initialization") Cc: Donet Tom <donettom@linux.ibm.com> Cc: Gang Li <gang.li@linux.dev> Cc: Daniel Jordan <daniel.m.jordan@oracle.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: David Rientjes <rientjes@google.com> Cc: Sourabh Jain <sourabhjain@linux.ibm.com> Cc: linux-mm@kvack.org Suggested-by: Muchun Song <muchun.song@linux.dev> Reported-by: Pavithra Prakash <pavrampu@linux.ibm.com> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> --- v1 -> v2: 1. Made .size = nr_node_ids instead of only online nodes as suggested by Muchun. [v1]: https://lore.kernel.org/linux-mm/7e0ca1e8acd7dd5c1fe7cbb252de4eb55a8e851b.1727984881.git.ritesh.list@gmail.com mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.5