lkml.org 
[lkml]   [2023]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/1] hugetlb: add timing to hugetlb allocations on boot
    Date
    Add timing to hugetlb allocations for further optimization.

    Debug only.

    Signed-off-by: Gang Li <gang.li@linux.dev>
    ---
    mm/hugetlb.c | 6 ++++++
    1 file changed, 6 insertions(+)

    diff --git a/mm/hugetlb.c b/mm/hugetlb.c
    index 1169ef2f2176f..51f50bb3dc092 100644
    --- a/mm/hugetlb.c
    +++ b/mm/hugetlb.c
    @@ -4490,6 +4490,7 @@ static inline void hugetlb_sysctl_init(void) { }
    static int __init hugetlb_init(void)
    {
    int i;
    + unsigned long start;

    BUILD_BUG_ON(sizeof_field(struct page, private) * BITS_PER_BYTE <
    __NR_HPAGEFLAGS);
    @@ -4536,8 +4537,11 @@ static int __init hugetlb_init(void)
    }

    hugetlb_cma_check();
    + start = jiffies;
    hugetlb_init_hstates();
    gather_bootmem_prealloc();
    + pr_info("HugeTLB: 2M alloc, init and 1G init takes %u ms\n",
    + jiffies_to_msecs(jiffies - start));
    report_hugepages();

    hugetlb_sysfs_init();
    @@ -4682,6 +4686,7 @@ static int __init hugepages_setup(char *s)
    }
    }

    + unsigned long start = jiffies;
    /*
    * Global state is always initialized later in hugetlb_init.
    * But we need to allocate gigantic hstates here early to still
    @@ -4692,6 +4697,7 @@ static int __init hugepages_setup(char *s)

    last_mhp = mhp;

    + pr_info("HugeTLB: 1G alloc takes %u ms\n", jiffies_to_msecs(jiffies - start));
    return 1;

    invalid:
    --
    2.30.2
    \
     
     \ /
      Last update: 2023-12-08 04:07    [W:4.054 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site