Skip to content

Commit 368a059

Browse files
kvaneeshakpm00
authored andcommitted
powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function
This is in preparation to update radix to implement vmemmap optimization for devdax. Below are the rules w.r.t radix vmemmap mapping 1. First try to map things using PMD (2M) 2. With altmap if altmap cross-boundary check returns true, fall back to PAGE_SIZE 3. If we can't allocate PMD_SIZE backing memory for vmemmap, fallback to PAGE_SIZE On removing vmemmap mapping, check if every subsection that is using the vmemmap area is invalid. If found to be invalid, that implies we can safely free the vmemmap area. We don't use the PAGE_UNUSED pattern used by x86 because with 64K page size, we need to do the above check even at the PAGE_SIZE granularity. [[email protected]: fix section mismatch warning] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: fix kernel build error] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Aneesh Kumar K.V <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Dan Williams <[email protected]> Cc: Joao Martins <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Muchun Song <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 27af67f commit 368a059

File tree

4 files changed

+329
-32
lines changed

4 files changed

+329
-32
lines changed

arch/powerpc/include/asm/book3s/64/radix.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ extern int __meminit radix__vmemmap_create_mapping(unsigned long start,
331331
unsigned long phys);
332332
int __meminit radix__vmemmap_populate(unsigned long start, unsigned long end,
333333
int node, struct vmem_altmap *altmap);
334+
void __ref radix__vmemmap_free(unsigned long start, unsigned long end,
335+
struct vmem_altmap *altmap);
334336
extern void radix__vmemmap_remove_mapping(unsigned long start,
335337
unsigned long page_size);
336338

arch/powerpc/include/asm/pgtable.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd)
157157
return (pgtable_t)pmd_page_vaddr(pmd);
158158
}
159159

160+
#ifdef CONFIG_PPC64
161+
int __meminit vmemmap_populated(unsigned long vmemmap_addr, int vmemmap_map_size);
162+
bool altmap_cross_boundary(struct vmem_altmap *altmap, unsigned long start,
163+
unsigned long page_size);
164+
#endif /* CONFIG_PPC64 */
165+
160166
#endif /* __ASSEMBLY__ */
161167

162168
#endif /* _ASM_POWERPC_PGTABLE_H */

0 commit comments

Comments
 (0)