powerpc/mm/slice: Simplify and optimise slice context initialisation

The slice state of an mm gets zeroed then initialised upon exec.
This is the only caller of slice_set_user_psize now, so that can be
removed and instead implement a faster and simplified approach that
requires no locking or checking existing state.

This speeds up vfork+exec+exit performance on POWER8 by 3%.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
这个提交包含在:
Nicholas Piggin
2018-03-07 11:37:09 +10:00
提交者 Michael Ellerman
父节点 ab83dc794c
当前提交 1753dd1830
修改 4 个文件,包含 23 行新增71 行删除

查看文件

@@ -93,13 +93,6 @@ static int hash__init_new_context(struct mm_struct *mm)
if (index < 0)
return index;
/*
* In the case of exec, use the default limit,
* otherwise inherit it from the mm we are duplicating.
*/
if (!mm->context.slb_addr_limit)
mm->context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64;
/*
* The old code would re-promote on fork, we don't do that when using
* slices as it could cause problem promoting slices that have been
@@ -115,7 +108,7 @@ static int hash__init_new_context(struct mm_struct *mm)
* check against 0 is OK.
*/
if (mm->context.id == 0)
slice_set_user_psize(mm, mmu_virtual_psize);
slice_init_new_context_exec(mm);
subpage_prot_init_new_context(mm);