[RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage

Aneesh Kumar K.V aneesh.kumar at linux.vnet.ibm.com
Fri Feb 22 16:14:09 EST 2013


David Gibson <david at gibson.dropbear.id.au> writes:

> On Thu, Feb 21, 2013 at 10:17:12PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar at linux.vnet.ibm.com>
>> 
>> We now have PTE page consuming only 2K of the 64K page.This is in order to
>> facilitate transparent huge page support, which works much better if our PMDs
>> cover 16MB instead of 256MB.
>> 
>> Inorder to reduce the wastage, we now have multiple PTE page fragment
>> from the same PTE page.
>
> This needs a much better description of what you're doing here to
> manage the allocations.  It's certainly not easy to figure out from
> the code.


I will add more detailed description in the commit message.

We allocate one page for the last level of linux page table. With THP and
large page size of 16MB, that would mean we are be wasting large part
of that page. To map 16MB area, we only need a PTE space of 2K with 64K
Page size. This patch reduce the space wastage by sharing the page
allocated for the last level of linux page table with multiple pmd
entries. We call these smaller chunks PTE page fragments and allocated
page, PTE page. We use the page->_mapcount as bitmap to indicate which
PTE fragments are free.


>
>
> [snip]
>> +#ifdef CONFIG_PPC_64K_PAGES
>> +typedef pte_t *pgtable_t;
>> +#else
>>  typedef struct page *pgtable_t;
>> +#endif
>
> This looks really bogus.  A pgtable_t is a pointer to PTEs on 64K, but
> a pointer to a struct page on 4k.
>

We enable all the above only with 64K Pages. 

-aneesh



More information about the Linuxppc-dev mailing list