[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231123133036.68540-4-gang.li@linux.dev>
Date: Thu, 23 Nov 2023 21:30:35 +0800
From: Gang Li <gang.li@...ux.dev>
To: Mike Kravetz <mike.kravetz@...cle.com>,
Muchun Song <muchun.song@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Gang Li <ligang.bdlg@...edance.com>
Subject: [RFC PATCH v1 3/4] hugetlb: add timing to hugetlb allocations on boot
From: Gang Li <ligang.bdlg@...edance.com>
Add timing to hugetlb allocations for further optimization.
Signed-off-by: Gang Li <ligang.bdlg@...edance.com>
---
mm/hugetlb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 7f9ff0855dd0..ac8558724cc2 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3563,7 +3563,7 @@ static unsigned long __init hugetlb_hstate_alloc_pages_non_gigantic(struct hstat
*/
static void __init hugetlb_hstate_alloc_pages(struct hstate *h)
{
- unsigned long allocated;
+ unsigned long allocated, start;
/* skip gigantic hugepages allocation if hugetlb_cma enabled */
if (hstate_is_gigantic(h) && hugetlb_cma_size) {
@@ -3576,11 +3576,13 @@ static void __init hugetlb_hstate_alloc_pages(struct hstate *h)
return;
/* below will do all node balanced alloc */
+ start = jiffies;
if (!hstate_is_gigantic(h)) {
allocated = hugetlb_hstate_alloc_pages_non_gigantic(h);
} else {
allocated = hugetlb_hstate_alloc_pages_gigantic(h);
}
+ pr_info("HugeTLB: Allocation takes %u ms\n", jiffies_to_msecs(jiffies - start));
hugetlb_hstate_alloc_pages_report(allocated, h);
}
--
2.20.1
Powered by blists - more mailing lists