Skip to content

Commit f049a4f

Browse files
committed
s390/mm: Add mmap_assert_write_locked() check to crst_table_upgrade()
Add mmap_assert_write_locked() check to crst_table_upgrade() in order to verify that no concurrent page table upgrades of an mm can happen. This allows to remove the VM_BUG_ON() check which checks for the potential inconsistent result of concurrent updates. Reviewed-by: Gerald Schaefer <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent de6b4f9 commit f049a4f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

arch/s390/mm/pgalloc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ int crst_table_upgrade(struct mm_struct *mm, unsigned long end)
5656
unsigned long *pgd = NULL, *p4d = NULL, *__pgd;
5757
unsigned long asce_limit = mm->context.asce_limit;
5858

59+
mmap_assert_write_locked(mm);
60+
5961
/* upgrade should only happen from 3 to 4, 3 to 5, or 4 to 5 levels */
6062
VM_BUG_ON(asce_limit < _REGION2_SIZE);
6163

@@ -79,13 +81,6 @@ int crst_table_upgrade(struct mm_struct *mm, unsigned long end)
7981

8082
spin_lock_bh(&mm->page_table_lock);
8183

82-
/*
83-
* This routine gets called with mmap_lock lock held and there is
84-
* no reason to optimize for the case of otherwise. However, if
85-
* that would ever change, the below check will let us know.
86-
*/
87-
VM_BUG_ON(asce_limit != mm->context.asce_limit);
88-
8984
if (p4d) {
9085
__pgd = (unsigned long *) mm->pgd;
9186
p4d_populate(mm, (p4d_t *) p4d, (pud_t *) __pgd);

0 commit comments

Comments
 (0)