Repository navigation
Commit 41f727f
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>1 parent 8f053ac commit 41f727f
3 files changed
Lines changed: 21 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 371 | | |
376 | 372 | | |
377 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 377 | | |
384 | 378 | | |
385 | 379 | | |
| |||
538 | 532 | | |
539 | 533 | | |
540 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
541 | 538 | | |
542 | 539 | | |
543 | 540 | | |
544 | 541 | | |
545 | 542 | | |
546 | 543 | | |
| 544 | + | |
| 545 | + | |
547 | 546 | | |
548 | 547 | | |
| 548 | + | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
551 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
552 | 556 | | |
553 | 557 | | |
554 | 558 | | |
| |||
558 | 562 | | |
559 | 563 | | |
560 | 564 | | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
565 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
566 | 576 | | |
567 | 577 | | |
568 | 578 | | |
| |||
596 | 606 | | |
597 | 607 | | |
598 | 608 | | |
599 | | - | |
600 | 609 | | |
601 | 610 | | |
602 | 611 | | |
| |||
828 | 837 | | |
829 | 838 | | |
830 | 839 | | |
831 | | - | |
832 | 840 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | 841 | | |
837 | 842 | | |
838 | 843 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | 844 | | |
843 | 845 | | |
844 | 846 | | |
| |||
860 | 862 | | |
861 | 863 | | |
862 | 864 | | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | 865 | | |
873 | 866 | | |
874 | 867 | | |
| |||
0 commit comments