Skip to content

Commit daa8af8

Browse files
sumanthkorikkarAlexander Gordeev
authored andcommitted
s390/mm: Allocate page table with PAGE_SIZE granularity
Make vmem_pte_alloc() consistent by always allocating page table of PAGE_SIZE granularity, regardless of whether page_table_alloc() (with slab) or memblock_alloc() is used. This ensures page table can be fully freed when the corresponding page table entries are removed. Fixes: d08d4e7 ("s390/mm: use full 4KB page for 2KB PTE") Reviewed-by: Heiko Carstens <[email protected]> Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Sumanth Korikkar <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 10dd5a0 commit daa8af8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/s390/mm/vmem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ void *vmem_crst_alloc(unsigned long val)
6464

6565
pte_t __ref *vmem_pte_alloc(void)
6666
{
67-
unsigned long size = PTRS_PER_PTE * sizeof(pte_t);
6867
pte_t *pte;
6968

7069
if (slab_is_available())
71-
pte = (pte_t *) page_table_alloc(&init_mm);
70+
pte = (pte_t *)page_table_alloc(&init_mm);
7271
else
73-
pte = (pte_t *) memblock_alloc(size, size);
72+
pte = (pte_t *)memblock_alloc(PAGE_SIZE, PAGE_SIZE);
7473
if (!pte)
7574
return NULL;
7675
memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE);

0 commit comments

Comments
 (0)