linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/5] hugetlb: parallelize hugetlb page init on boot
@ 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
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Gang Li @ 2023-12-08  2:52 UTC (permalink / raw)
  To: David Hildenbrand, David Rientjes, Mike Kravetz, Muchun Song,
	Andrew Morton
  Cc: linux-mm, linux-kernel, ligang.bdlg, Gang Li

Hi all, hugetlb init parallelization has now been updated to v2.

To David Hildenbrand: padata multithread utilities has been used to reduce
code complexity.

To David Rientjes: The patch for measuring time will be separately included
in the reply. Please test during your free time, thanks.

# Introduction
Hugetlb initialization during boot takes up a considerable amount of time.
For instance, on a 2TB system, initializing 1,800 1GB huge pages takes 1-2
seconds out of 10 seconds. Initializing 11,776 1GB pages on a 12TB Intel
host takes 65.2 seconds [1], which is 17.4% of the total 373.78 seconds boot
time. This is a noteworthy figure.

Inspired by [2] and [3], hugetlb initialization can also be accelerated
through parallelization. Kernel already has infrastructure like
padata_do_multithreaded, this patch uses it to achieve effective results
by minimal modifications.

[1] https://lore.kernel.org/all/783f8bac-55b8-5b95-eb6a-11a583675000@google.com/
[2] https://lore.kernel.org/all/20200527173608.2885243-1-daniel.m.jordan@oracle.com/
[3] https://lore.kernel.org/all/20230906112605.2286994-1-usama.arif@bytedance.com/

# Test result
        test          no patch(ms)   patched(ms)   saved   
 ------------------- -------------- ------------- -------- 
  256c2t(4 node) 2M           2624           956   63.57%  
  256c2t(4 node) 1G           2679          1582   40.95%  
  128c1t(2 node) 2M           1788           684   61.74%  
  128c1t(2 node) 1G           3160          1618   48.80%  

# Change log
Changes in v2:
- Reduce complexity with `padata_do_multithreaded`
- Support 1G hugetlb

v1:
- https://lore.kernel.org/all/20231123133036.68540-1-gang.li@linux.dev/
- parallelize 2M hugetlb initialization with workqueue

Gang Li (5):
  hugetlb: code clean for hugetlb_hstate_alloc_pages
  hugetlb: split hugetlb_hstate_alloc_pages
  padata: dispatch works on different nodes
  hugetlb: parallelize 2M hugetlb allocation and initialization
  hugetlb: parallelize 1G hugetlb initialization

 include/linux/hugetlb.h |   2 +-
 include/linux/padata.h  |   2 +
 kernel/padata.c         |   8 +-
 mm/hugetlb.c            | 201 +++++++++++++++++++++++++++-------------
 mm/mm_init.c            |   1 +
 5 files changed, 148 insertions(+), 66 deletions(-)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-12-27 10:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08  2:52 [RFC PATCH v2 0/5] hugetlb: parallelize hugetlb page init on boot 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
2023-12-25  6:24             ` Gang Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox