linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Gang Li <ligang.bdlg@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>,
	Gang Li <gang.li@linux.dev>,
	 David Hildenbrand <david@redhat.com>,
	Muchun Song <muchun.song@linux.dev>,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 0/5] hugetlb: parallelize hugetlb page init on boot
Date: Sun, 24 Dec 2023 21:21:03 -0800 (PST)	[thread overview]
Message-ID: <76becfc1-e609-e3e8-2966-4053143170b6@google.com> (raw)
In-Reply-To: <4c6de257-ebb4-e9ad-4092-b81a8039aff4@google.com>

On Thu, 21 Dec 2023, David Rientjes wrote:

> > Hi,
> > 
> > On 2023/12/13 08:10, David Rientjes wrote:
> > > On 6.6 I measured "hugepagesz=1G hugepages=11776" on as 12TB host to be
> > > 77s this time around.
> > 
> > Thanks for your test! Is this the total kernel boot time, or just the
> > hugetlb initialization time?
> > 
> 
> Ah, sorry for not being specific.  It's just the hugetlb preallocation of 
> 11776 1GB hugetlb pages, total boot takes a few more minutes.
> 

I had to apply this to get the patch series to compile on 6.7-rc7:

diff --git a/kernel/padata.c b/kernel/padata.c
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -485,7 +485,7 @@ void __init padata_do_multithreaded(struct padata_mt_job *job)
 	struct padata_work my_work, *pw;
 	struct padata_mt_job_state ps;
 	LIST_HEAD(works);
-	int nworks, nid;
+	int nworks, nid = 0;
 
 	if (job->size == 0)
 		return;
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3300,7 +3300,7 @@ int alloc_bootmem_huge_page(struct hstate *h, int nid)
 int __alloc_bootmem_huge_page(struct hstate *h, int nid)
 {
 	struct huge_bootmem_page *m = NULL; /* initialize for clang */
-	int nr_nodes, node;
+	int nr_nodes, node = NUMA_NO_NODE;
 
 	/* do node specific alloc */
 	if (nid != NUMA_NO_NODE) {

With that, I compared "hugepagesz=1G hugepages=11776" before and after on 
a 12TB host with eight NUMA nodes.

Compared to 77s of total initialization time before, with this series I 
measured 18.3s.

Feel free to add this into the changelog once the initialization issues 
are fixed up and I'm happy to ack it.

Thanks!


  reply	other threads:[~2023-12-25  5:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  2:52 Gang Li
2023-12-08  2:52 ` [RFC PATCH v2 1/5] hugetlb: code clean for hugetlb_hstate_alloc_pages Gang Li
2023-12-08  2:52 ` [RFC PATCH v2 2/5] hugetlb: split hugetlb_hstate_alloc_pages Gang Li
2023-12-08  2:52 ` [RFC PATCH v2 3/5] padata: dispatch works on different nodes Gang Li
2023-12-12 23:40   ` Tim Chen
2023-12-18  6:46     ` Gang Li
2023-12-27 10:33       ` Gang Li
2023-12-08  2:52 ` [RFC PATCH v2 4/5] hugetlb: parallelize 2M hugetlb allocation and initialization Gang Li
2023-12-08  2:52 ` [RFC PATCH v2 5/5] hugetlb: parallelize 1G hugetlb initialization Gang Li
2023-12-08  2:56 ` [PATCH 1/1] hugetlb: add timing to hugetlb allocations on boot Gang Li
2023-12-12 20:06 ` [RFC PATCH v2 0/5] hugetlb: parallelize hugetlb page init " Mike Kravetz
2023-12-21  7:22   ` Gang Li
2023-12-12 22:14 ` David Rientjes
2023-12-12 23:08   ` Mike Kravetz
2023-12-13  0:10     ` David Rientjes
2023-12-18  6:34       ` Gang Li
2023-12-22  4:33         ` David Rientjes
2023-12-25  5:21           ` David Rientjes [this message]
2023-12-25  6:24             ` Gang Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76becfc1-e609-e3e8-2966-4053143170b6@google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=gang.li@linux.dev \
    --cc=ligang.bdlg@bytedance.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=muchun.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox