[PATCH v2] makedumpfile: Exclude unnecessary hugepages.

bhe at redhat.com bhe at redhat.com
Fri Jul 18 01:47:26 PDT 2014


On 07/18/14 at 09:38am, Petr Tesarik wrote:
> On Fri, 18 Jul 2014 10:16:16 +0800
> "bhe at redhat.com" <bhe at redhat.com> wrote:
> 
Thanks, Petr. This help. 

> I'm afraid you misunderstand the concept. Let me explain:
> 
> page:
>   The basic memory management block (usually 4K).
> 
> compound page:
>   The kernel may group adjacent pages into a larger object, and track
>   page flags, refcount, etc. at one place for the whole group. This is
>   called compound pages.
> 
>   Compound pages may be used for different things, either kernel
>   internal allocations or by applications.
> 
>   Note that compound pages may or may not correspond to fewer levels of
>   paging in hardware. Take x86_64 as an example. You can have compound
>   pages with order=1 (i.e. 8K). There is nothing in the hardware to
>   support such page size, so the page table just contains 2 consecutive
>   4K pages. Only if you have a compound page with order=9 (i.e. 2M), the
>   kernel can use 3-level paging, creating a 2M page in hardware.
> 
> hugetlbfs:
>   Some compound pages are available through a special filesystem. This
>   filesystem is used solely by user-space applications. However, these
>   pages are formally owned by the kernel (after all, they belong to a
>   filesystem, albeit a very special one). There is nothing in the page
>   flags to tell that they are in fact used by user-space.

I do have a confusion on this. Here it means user space benefits from
hugetlb only through hugetlbfs. If except of that, kernel may make use
of hugetlb to get large memory by merging continuous pages, doesn't it?

I checked Documentation/vm/hugetlbpage.txt and other documents, didn't
see kernel also use hugetlb memory. I don't mean the hugetlb management,
all physical memory is managed by kernel.  


> 
>   The primary intent was to let applications use less levels of paging
>   in hardware to improve performance. This mechanism requires special
>   support in the application.
> 
> transparent huge pages:
>   THP is a method to offer the performance benefits of hugetlbfs to
>   applications that don't use the special hugetlbfs API. To do that,
>   the kernel automatically merges adjacent physical pages into compound
>   pages. In this case, the page flags (stored in the "head page") can
>   be used to determine the use of that page.
> 
> Hope that helps,
> Petr Tesarik



More information about the kexec mailing list