mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
fork/exec: cleanup mm initialization
mm initialization on fork/exec is spread all over the place, which makes the code look inconsistent. We have mm_init(), which is supposed to init/nullify mm's internals, but it doesn't init all the fields it should: - on fork ->mmap,mm_rb,vmacache_seqnum,map_count,mm_cpumask,locked_vm are zeroed in dup_mmap(); - on fork ->pmd_huge_pte is zeroed in dup_mm(), immediately before calling mm_init(); - ->cpu_vm_mask_var ptr is initialized by mm_init_cpumask(), which is called before mm_init() on both fork and exec; - ->context is initialized by init_new_context(), which is called after mm_init() on both fork and exec; Let's consolidate all the initializations in mm_init() to make the code look cleaner. Signed-off-by: Vladimir Davydov <vdavydov@parallels.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
8f053ac11f
commit
41f727fde1
3 changed files with 21 additions and 31 deletions
|
|
@ -368,10 +368,6 @@ static int bprm_mm_init(struct linux_binprm *bprm)
|
|||
if (!mm)
|
||||
goto err;
|
||||
|
||||
err = init_new_context(current, mm);
|
||||
if (err)
|
||||
goto err;
|
||||
|
||||
err = __bprm_mm_init(bprm);
|
||||
if (err)
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue