Commit c1b8245
sched_ext: Simplify breather mechanism with scx_aborting flag
[ Upstream commit a69040e ]
The breather mechanism was introduced in 62dcbab ("sched_ext: Avoid
live-locking bypass mode switching") and e32c260 ("sched_ext: Enable the
ops breather and eject BPF scheduler on softlockup") to prevent live-locks by
injecting delays when CPUs are trapped in dispatch paths.
Currently, it uses scx_breather_depth (atomic_t) and scx_in_softlockup
(unsigned long) with separate increment/decrement and cleanup operations. The
breather is only activated when aborting, so tie it directly to the exit
mechanism. Replace both variables with scx_aborting flag set when exit is
claimed and cleared after bypass is enabled. Introduce scx_claim_exit() to
consolidate exit_kind claiming and breather enablement. This eliminates
scx_clear_softlockup() and simplifies scx_softlockup() and scx_bypass().
The breather mechanism will be replaced by a different abort mechanism in a
future patch. This simplification prepares for that change.
Reviewed-by: Dan Schatzberg <schatzberg.dan@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Acked-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 83236b2 ("sched_ext: Disable preemption between scx_claim_exit() and kicking helper work")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent c44198f commit c1b8245
1 file changed
+25
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | 36 | | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
1791 | 1790 | | |
1792 | 1791 | | |
1793 | 1792 | | |
1794 | | - | |
| 1793 | + | |
1795 | 1794 | | |
1796 | 1795 | | |
1797 | 1796 | | |
| |||
1800 | 1799 | | |
1801 | 1800 | | |
1802 | 1801 | | |
1803 | | - | |
| 1802 | + | |
1804 | 1803 | | |
1805 | | - | |
| 1804 | + | |
1806 | 1805 | | |
1807 | 1806 | | |
1808 | 1807 | | |
| |||
3718 | 3717 | | |
3719 | 3718 | | |
3720 | 3719 | | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
3724 | | - | |
3725 | 3720 | | |
3726 | 3721 | | |
3727 | 3722 | | |
3728 | | - | |
3729 | | - | |
3730 | | - | |
3731 | | - | |
3732 | | - | |
3733 | | - | |
3734 | 3723 | | |
3735 | 3724 | | |
3736 | 3725 | | |
3737 | 3726 | | |
3738 | 3727 | | |
3739 | | - | |
3740 | | - | |
3741 | | - | |
3742 | | - | |
3743 | | - | |
3744 | | - | |
3745 | 3728 | | |
3746 | 3729 | | |
3747 | 3730 | | |
| |||
3802 | 3785 | | |
3803 | 3786 | | |
3804 | 3787 | | |
3805 | | - | |
3806 | | - | |
3807 | 3788 | | |
3808 | 3789 | | |
3809 | 3790 | | |
| |||
3860 | 3841 | | |
3861 | 3842 | | |
3862 | 3843 | | |
3863 | | - | |
3864 | 3844 | | |
3865 | 3845 | | |
3866 | | - | |
3867 | 3846 | | |
3868 | 3847 | | |
3869 | 3848 | | |
| |||
3958 | 3937 | | |
3959 | 3938 | | |
3960 | 3939 | | |
| 3940 | + | |
3961 | 3941 | | |
3962 | 3942 | | |
3963 | 3943 | | |
| |||
4086 | 4066 | | |
4087 | 4067 | | |
4088 | 4068 | | |
4089 | | - | |
| 4069 | + | |
4090 | 4070 | | |
4091 | 4071 | | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
4092 | 4087 | | |
4093 | 4088 | | |
4094 | 4089 | | |
| |||
4097 | 4092 | | |
4098 | 4093 | | |
4099 | 4094 | | |
4100 | | - | |
| 4095 | + | |
4101 | 4096 | | |
4102 | 4097 | | |
4103 | 4098 | | |
| |||
4418 | 4413 | | |
4419 | 4414 | | |
4420 | 4415 | | |
4421 | | - | |
4422 | 4416 | | |
4423 | | - | |
| 4417 | + | |
4424 | 4418 | | |
4425 | 4419 | | |
4426 | 4420 | | |
| |||
4645 | 4639 | | |
4646 | 4640 | | |
4647 | 4641 | | |
| 4642 | + | |
| 4643 | + | |
4648 | 4644 | | |
4649 | 4645 | | |
4650 | 4646 | | |
| |||
0 commit comments