[PATCH v3] makedumpfile: Exclude unnecessary hugepages.
Atsushi Kumagai
kumagai-atsushi at mxc.nes.nec.co.jp
Fri Aug 1 00:12:42 PDT 2014
>Hi Atsushi,
>
>Patch looks good. Only a small concern.
>
>
> + mdf_pfn_t nr_pages;
>> unsigned long index_pg, pfn_mm;
>> unsigned long long maddr;
>> mdf_pfn_t pfn_read_start, pfn_read_end;
>> unsigned char page_cache[SIZE(page) * PGMM_CACHED];
>> unsigned char *pcache;
>> - unsigned int _count, _mapcount = 0;
>> + unsigned int _count, _mapcount = 0, compound_order = 0;
>> unsigned long flags, mapping, private = 0;
>> + unsigned long hugetlb_dtor;
> ~~~~~~~~~~~~~
>>
>> /*
>> * If a multi-page exclusion is pending, do it first
>> @@ -4708,11 +4728,36 @@ __exclude_unnecessary_pages(unsigned long mem_map,
>> flags = ULONG(pcache + OFFSET(page.flags));
>> _count = UINT(pcache + OFFSET(page._count));
>> mapping = ULONG(pcache + OFFSET(page.mapping));
>> +
>> + if (index_pg < PGMM_CACHED - 1) {
>> + compound_order = ULONG(pcache + SIZE(page) + OFFSET(page.lru)
>> + + OFFSET(list_head.prev));
>> + hugetlb_dtor = ULONG(pcache + SIZE(page) + OFFSET(page.lru)
>> + + OFFSET(list_head.next));
>
>Here I think the variable should be compound_page_dtor because it could
>be free_compound_page if it's thp or normal huge page. Only if it's a
>hugetlb huge page, it will be free_huge_page. So for removing confusion
>and future extention, it could be named as compound_page_dtor or
>compound_dtor, a more generic name.
Sounds good to me, I'll fix it in the next version.
Thanks
Atsushi Kumagai.
>Thanks
>Baoquan
>
>
>> +
>> + if (compound_order &&
>> + ((compound_order >= sizeof(unsigned long) * 8)
>> + || (pfn & ((1UL << compound_order) - 1)) != 0)) {
>> + /* Invalid order */
>> + compound_order = 0;
>> + }
More information about the kexec
mailing list