Commit 3e0fea0
tracing/user_events: Split up mm alloc and attach
When a new mm is being created in a fork() path it currently is
allocated and then attached in one go. This leaves the mm exposed out to
the tracing register callbacks while any parent enabler locations are
copied in. This should not happen.
Split up mm alloc and attach as unique operations. When duplicating
enablers, first alloc, then duplicate, and only upon success, attach.
This prevents any timing window outside of the event_reg mutex for
enablement walking. This allows for dropping RCU requirement for
enablement walking in later patches.
Link: https://lkml.kernel.org/r/20230519230741.669-2-beaub@linux.microsoft.com
Link: https://lore.kernel.org/linux-trace-kernel/CAHk-=whTBvXJuoi_kACo3qi5WZUmRrhyA-_=rRFsycTytmB6qw@mail.gmail.com/
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ change log written by Beau Belgrave ]
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 632478a commit 3e0fea0
1 file changed
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
546 | 545 | | |
547 | 546 | | |
548 | 547 | | |
| |||
554 | 553 | | |
555 | 554 | | |
556 | 555 | | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | 556 | | |
564 | 557 | | |
565 | 558 | | |
| |||
573 | 566 | | |
574 | 567 | | |
575 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
576 | 580 | | |
577 | 581 | | |
578 | 582 | | |
579 | 583 | | |
580 | 584 | | |
581 | 585 | | |
582 | 586 | | |
583 | | - | |
| 587 | + | |
584 | 588 | | |
585 | 589 | | |
586 | 590 | | |
| 591 | + | |
| 592 | + | |
587 | 593 | | |
588 | 594 | | |
589 | 595 | | |
| |||
671 | 677 | | |
672 | 678 | | |
673 | 679 | | |
674 | | - | |
| 680 | + | |
675 | 681 | | |
676 | 682 | | |
677 | 683 | | |
| |||
685 | 691 | | |
686 | 692 | | |
687 | 693 | | |
| 694 | + | |
688 | 695 | | |
689 | 696 | | |
690 | 697 | | |
691 | | - | |
| 698 | + | |
692 | 699 | | |
693 | 700 | | |
694 | 701 | | |
| |||
0 commit comments