-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANDROID: sched: check on_rq in freezer_should_skip()
In aosp/1979327 we attempted to prevent tasks with pending signals and PF_FREEZER_SKIP from being immediately rescheduled, because such tasks would crash the kernel if run while no capable CPUs were online. This was implemented by declining to immediately reschedule them unless various conditions were met. However, this ended up causing signals to fail to be delivered if the signal was received while a task is processing a syscall, such as futex(2), that will block with PF_FREEZER_SKIP set, as the kernel relies on a check for TIF_SIGPENDING after setting the task state to TASK_INTERRUPTIBLE in order to deliver such a signal. This patch is an alternative solution to the original problem that avoids introducing the signal delivery bug. It works by changing how freezer_should_skip() is implemented. Instead of just checking PF_FREEZER_SKIP, we also use the on_rq field to check whether the task is not on a runqueue. In this way we ensure that a task that will be immediately rescheduled will not return true from freezer_should_skip(), and the task will block the freezer unless it is actually taken off the runqueue. Signed-off-by: Peter Collingbourne <[email protected]> Bug: 202918514 Bug: 251700836 Change-Id: I3f9b705ce9ad2ca1d2df959f43cf05bef78560f8
- Loading branch information
Showing
4 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters