mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 04:42:12 +00:00
67850b7bdc
of Peter Zijlstra was encountering with ptrace in his freezer rewrite I identified some cleanups to ptrace_stop that make sense on their own and move make resolving the other problems much simpler. The biggest issue is the habbit of the ptrace code to change task->__state from the tracer to suppress TASK_WAKEKILL from waking up the tracee. No other code in the kernel does that and it is straight forward to update signal_wake_up and friends to make that unnecessary. Peter's task freezer sets frozen tasks to a new state TASK_FROZEN and then it stores them by calling "wake_up_state(t, TASK_FROZEN)" relying on the fact that all stopped states except the special stop states can tolerate spurious wake up and recover their state. The state of stopped and traced tasked is changed to be stored in task->jobctl as well as in task->__state. This makes it possible for the freezer to recover tasks in these special states, as well as serving as a general cleanup. With a little more work in that direction I believe TASK_STOPPED can learn to tolerate spurious wake ups and become an ordinary stop state. The TASK_TRACED state has to remain a special state as the registers for a process are only reliably available when the process is stopped in the scheduler. Fundamentally ptrace needs acess to the saved register values of a task. There are bunch of semi-random ptrace related cleanups that were found while looking at these issues. One cleanup that deserves to be called out is from commit |
||
---|---|---|
.. | ||
syscalls | ||
.gitignore | ||
align.S | ||
asm-offsets.c | ||
coprocessor.S | ||
entry.S | ||
head.S | ||
hibernate.c | ||
hw_breakpoint.c | ||
irq.c | ||
jump_label.c | ||
Makefile | ||
mcount.S | ||
module.c | ||
mxhead.S | ||
pci-dma.c | ||
pci.c | ||
perf_event.c | ||
platform.c | ||
process.c | ||
ptrace.c | ||
s32c1i_selftest.c | ||
setup.c | ||
signal.c | ||
smp.c | ||
stacktrace.c | ||
syscall.c | ||
time.c | ||
traps.c | ||
vectors.S | ||
vmlinux.lds.S | ||
xtensa_ksyms.c |