ppc64: update to use the new 4L headers
PATCH 1/1 ppc64: update to use the new 4L headers
Hi !
This patch converts ppc64 to use the generic pgtable-nopud.h instead of the "fixup" header.
include/asm-ppc64/pgalloc.h +1 -1
@@ -27,7 +27,7 @@kmem_cache_free (zero_cache, pgd); } -#define pgd_populate (MM ,PGD ,PMD ) pgd_set(PGD, PMD) +#define pud_populate (MM ,PUD ,PMD ) pud_set(PUD, PMD)static inline pmd_t *pmd_alloc_one (struct mm_struct *mm,unsigned long addr)
include/asm-ppc64/pgtable.h +24 -19
82 lines not on this page · raw message
arch/ppc64/mm/init.c +101 -97
282 lines not on this page · raw message
arch/ppc64/mm/hugetlbpage.c +22 -23
119 lines not on this page · raw message
Quoted 5 lines · Benjamin Herrenschmidt
Hi !
This patch converts ppc64 to use the generic
pgtable-nopud.hinstead of the "fixup" header.
Great! Nice work Ben.
Quoted 18 lines
arch/ppc64/mm/init.c +0
-18- -static void unmap_im_area_pmd (pgd_t *dir,unsigned long address, -unsigned long size) -{ -unsigned long base, end; -pmd_t *pmd; - -if (pgd_none (*dir)) -return ; -if (pgd_bad (*dir)) { -pgd_ERROR (*dir); -pgd_clear (dir); -return ; - } - - pmd =pmd_offset (dir, address); - base = address &PGDIR_MASK ; - address &= ~PGDIR_MASK ;
arch/ppc64/mm/init.c line 348
Quoted 10 lines
arch/ppc64/mm/init.c +0
-10- end = address + size; -if (end >PGDIR_SIZE ) - end =PGDIR_SIZE ; - -do { -unmap_im_area_pte (pmd, base + address, end - address); - address = (address +PMD_SIZE ) &PMD_MASK ; - pmd++; - }while (address < end); -}
Just a bit off-topic: I wonder how many more of these open coded pt walks exist in arch code (yes I see you've cleaned yours up - good).
I guess they don't matter much? They will probably get converted when arches convert to the 4L headers.
Signature · 1 line
SUSE Labs, Novell Inc.
Quoted 3 lines · Nick Piggin
Just a bit off-topic: I wonder how many more of these open coded pt walks exist in arch code (yes I see you've cleaned yours up - good).
I know there's open coded walks outside the tree (I maintain one) due to there being no suitable function available from with in it...
I needed something like:
pte_t *va_to_ptep_map(struct mm_struct *mm, unsigned int addr)
There was code in follow_page() that did basically what I needed, but it was all contained within that function so I had to re-implement it.
Chris
Quoted 9 lines · Chris Friesen
Quoted 3 lines · Nick Piggin
Just a bit off-topic: I wonder how many more of these open coded pt walks exist in arch code (yes I see you've cleaned yours up - good).
I know there's open coded walks outside the tree (I maintain one) due to there being no suitable function available from with in it...
Oh - I meant hand calculating the addresses rather than using the pmd_addr_end and friends... but:
Quoted 6 lines
I needed something like:
pte_t*va_to_ptep_map(structmm_struct*mm, unsigned int addr)There was code in
follow_page()that did basically what I needed, but it was all contained within that function so I had to re-implement it.
If you can break out exactly what you need, and make that inline or otherwise available via the correct header, I'm sure it would have a good chance of being merged.
Keep in mind that you shouldn't introduce an inefficiency to follow_page, however if that is not possible you could simply duplicate what you need in a seperate function in mm/memory.c and use that - better to do it once there than a lot of times in random places.
Signature · 1 line
SUSE Labs, Novell Inc.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Nick" == Nick Piggin <[email protected]> writes:
Quoted 8 lines · Nick> Chris Friesen wrote:
Quoted 8 lines
I needed something like:
pte_t*va_to_ptep_map(structmm_struct*mm, unsigned int addr)There was code in
follow_page()that did basically what I needed, but it was all contained within that function so I had to re-implement it.
Nick> If you can break out exactly what you need, and make that inline Nick> or otherwise available via the correct header, I'm sure it would Nick> have a good chance of being merged.
We're currently working on this, so as to be able to provide interfaces to alternative page tables. We want to be able to slot in Liedtke's `Guarded Page Tables', or B-trees, or a hash table to see what happens.
Except we've called the function:
pte_t * lookup_page_table(unsigned long address, struct mm_struct *mm);
follow_page() is essentially the same after inline expansion happens; but we're seeing a regression in clear_page_range() that we want to fix before release.
If you want to take a look (warning: it's still fairly rough work-in-progress) there's high level design being worked on at
http://www.gelato.unsw.edu.au/IA64wiki/PageTableInterface
and patches from our CVS repository. The only patch of interst is pti.patch.
cvs -d :pserver:[email protected]:/gelato login Logging in to :pserver:anoncvs@lemon:2401/gelato CVS password:[enter anoncvs]
$ cvs -d:pserver:[email protected]:/gelato co kernel/page_table_interface
or from
http://www.gelato.unsw.edu.au/cgi-bin/viewcvs.cgi/cvs/kernel/page_table_interface/
Peter C