This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scx: Invoke ops.exit_task() for TASK_DEAD tasks on disable path
In commit f266831 ("scx: Close a small race window in the enable path which can lead to use-after-free"), we fixed a race window on the enable path that could cause a crash. This fix is fine, but was a bit too aggressive in that it could also cause us to miss ops.exit_task() invocations in the following scenario: 1. A task exits and invokes do_task_dead() (making its state TASK_DEAD), but someone still holds a refcount on it somewhere. 2. The scheduler is disabled. 3. On the disable path, we don't invoke ops.task_exit() 4. We don't invoke it in sched_ext_free() either later, because by then the scheduler has been disabled. Let's ensure we don't skip on exiting the task by still calling scx_ops_exit_task() for TASK_DEAD tasks on the disable path. Signed-off-by: David Vernet <[email protected]>
- Loading branch information