[2/2] powerpc: support for 256K pages on PPC 44x

Yuri Tikhonov yur at emcraft.com
Fri Nov 14 15:32:49 EST 2008


Hello Milton,

On Tuesday, November 11, 2008 Milton Miller wrote:

[snip]

>>>>
>>>>  #ifdef CONFIG_PTE_64BIT
>>>>  typedef unsigned long long pte_basic_t;
>>>> +#ifdef CONFIG_PPC_256K_PAGES
>>>> +#define PTE_SHIFT       (PAGE_SHIFT - 7)
>>>
>>> This seems to be missing the comment on how many ptes are actually in
>>> the page that are in the other if and else cases.
>>
>> Ok. I'll fix this. Actually it's another hack: we don't use full page
>> for PTE table because we need to reserve something for PGD

> I don't understand "we need to reserve something for PGD".   Do you 
> mean that you would not require a second page for the PGD because the 
> full pagetable could fit in one page?   My first reaction was to say 
> then create pgtable-nopgd.h like the other two.  The page walkers 
> support this with the advent of gigantic pages.  Then I realized that 
> might not be optimal:  while the page table might fit in one page, it 
> would mean you always allocate the pte space to cover the full address
> space.   Even if your processes spread out over the 3G of address space
> allocated to them (32 bit kernel), you will allocate space for 4G, 
> wasting 1/4 of the pte space.
> That does imply you want to allocate the pte page from a slab instead 
> of pgalloc.  Is that covered?

 Well, in case of 256K PAGE_SIZE we do not need the PGD level indeed
(18 bits are used for offset, and remaining 14 bits are for PTE index 
inside the PTE table). Even the full 256K PTE page isn't necessary to 
cover the full range: only half of it would be enough (with 14 bits we 
can address only 16K PTEs).

 But the head_44x.S code is essentially based on the assumption of 
2-level page addressing. Also, I may guess that eliminating of the
PGD level won't be as easy as just a re-implementation of the TLB-miss 
handlers in head_44x.S. So, the current approach for 256K-pages 
support was just a compromise between the required for the project 
functionality, and the effort necessary to achieve it.

 Regards, Yuri

 --
 Yuri Tikhonov, Senior Software Engineer
 Emcraft Systems, www.emcraft.com




More information about the Linuxppc-dev mailing list