Commit 0031f1c7 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Vasily Gorbik

s390/mm: use compound page order to distinguish page tables

CRSTs always have size of four pages, while 2KB-size page tables
always occupy a single page. Use that information to distinguish
page tables from CRSTs.
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Reviewed-by: default avatarGerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent d08d4e7c
...@@ -199,20 +199,15 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table, ...@@ -199,20 +199,15 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
mm = tlb->mm; mm = tlb->mm;
if (mm_alloc_pgste(mm)) if (mm_alloc_pgste(mm))
gmap_unlink(mm, table, vmaddr); gmap_unlink(mm, table, vmaddr);
table = (unsigned long *)((unsigned long)table | 0x01U);
tlb_remove_ptdesc(tlb, table); tlb_remove_ptdesc(tlb, table);
} }
void __tlb_remove_table(void *_table) void __tlb_remove_table(void *table)
{ {
struct ptdesc *ptdesc; struct ptdesc *ptdesc = virt_to_ptdesc(table);
unsigned int mask; struct page *page = ptdesc_page(ptdesc);
void *table;
mask = (unsigned long)_table & 0x01U; if (compound_order(page) == CRST_ALLOC_ORDER) {
table = (void *)((unsigned long)_table ^ mask);
ptdesc = virt_to_ptdesc(table);
if (!mask) {
/* pmd, pud, or p4d */ /* pmd, pud, or p4d */
pagetable_free(ptdesc); pagetable_free(ptdesc);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment