Files
erofs-linux/include/linux
Vladimir Davydov 41f727fde1 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 <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2014-08-08 15:57:23 -07:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-08-01 22:35:55 +08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-07-08 13:36:52 -07:00
2014-07-04 18:55:13 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-08-06 18:01:24 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-08-06 18:01:19 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-06-06 16:08:13 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-07-08 09:40:06 +02:00
…
…
…
…
…
…
2014-06-16 16:26:54 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-07-22 21:55:45 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-07-17 22:07:37 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-07-09 14:58:37 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-06-04 16:54:21 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-06-04 16:54:12 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-06-06 16:08:12 -07:00
…
…
…
…
…
…
…
…
…
…
…
2014-06-12 00:21:11 -04:00
…
…
…
…
…
…
…
…
…
…
2014-08-08 15:57:17 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-08-08 15:57:22 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2014-08-06 18:01:24 -07:00
…
…