linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mm-unstable v1 0/3] mm/hugetlb: alloc/free gigantic folios
@ 2024-08-11 21:21 Yu Zhao
  2024-08-11 21:21 ` [PATCH mm-unstable v1 1/3] mm/contig_alloc: support __GFP_COMP Yu Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yu Zhao @ 2024-08-11 21:21 UTC (permalink / raw)
  To: Andrew Morton, Muchun Song
  Cc: Matthew Wilcox (Oracle), Zi Yan, linux-mm, linux-kernel, Yu Zhao

Use __GFP_COMP for gigantic folios can greatly reduce not only the
complexity in the code but also the allocation and free time.

Approximate LOC to mm/hugetlb.c: -200, +50

Allocate and free 500 1GB hugeTLB memory without HVO by:
  time echo 500 >/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
  time echo 0 >/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages

       Before  After
Alloc  ~13s    ~10s
Free   ~15s    <1s

The above magnitude generally holds for multiple x86 and arm64 CPU
models.

Yu Zhao (3):
  mm/contig_alloc: support __GFP_COMP
  mm/cma: add cma_alloc_folio()
  mm/hugetlb: use __GFP_COMP for gigantic folios

 include/linux/cma.h     |   1 +
 include/linux/hugetlb.h |   9 +-
 mm/cma.c                |  47 +++++---
 mm/compaction.c         |  48 +-------
 mm/hugetlb.c            | 244 ++++++++--------------------------------
 mm/internal.h           |   9 ++
 mm/page_alloc.c         | 111 +++++++++++++-----
 7 files changed, 177 insertions(+), 292 deletions(-)


base-commit: b447504e1fed49fabbc03d6c2530126824f87c92
prerequisite-patch-id: 9fe502f7c87a9f951d0aee61f426bd85bc43ef74
-- 
2.46.0.76.ge559c4bf1a-goog



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

end of thread, other threads:[~2024-08-15 18:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-11 21:21 [PATCH mm-unstable v1 0/3] mm/hugetlb: alloc/free gigantic folios Yu Zhao
2024-08-11 21:21 ` [PATCH mm-unstable v1 1/3] mm/contig_alloc: support __GFP_COMP Yu Zhao
2024-08-11 21:21 ` [PATCH mm-unstable v1 2/3] mm/cma: add cma_alloc_folio() Yu Zhao
2024-08-15 14:40   ` Kefeng Wang
2024-08-15 18:04     ` Yu Zhao
2024-08-15 18:25       ` Yu Zhao
2024-08-15 18:48         ` Usama Arif
2024-08-11 21:21 ` [PATCH mm-unstable v1 3/3] mm/hugetlb: use __GFP_COMP for gigantic folios Yu Zhao

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