Skip to content

posix-cpu-timers: Graceful handling of reaped processes

Eric W. Biederman lkml 1 version Applied

Status from this message: The following commit has been merged into the timers/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5posix-cpu-timers: cpu_clock_sample_group no longer needs siglockkernel/time/posix-cpu-timers.c+1 -30 replies
2/5posix-cpu-timers: Remove unnecessary locking around cpu_clock_sample_groupkernel/time/posix-cpu-timers.c+7 -480 replies
3/5posix-cpu-timers: Pass the task into arm_timerkernel/time/posix-cpu-timers.c+3 -40 replies
4/5posix-cpu-timers: Store a reference to a pid not a taskinclude/linux/posix-timers.h kernel/time/posix-cpu-timers.c+56 -190 replies
5/5posix-cpu-timers: Stop disabling timers on mt-execkernel/exit.c+1 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] posix-cpu-timers: Graceful handling of reaped processes

Oleg, Thomas,

The posic cpu timer code does not handle processes that is is using as a clock source exiting and being reaped at all well. In most cases the code pins the entire task struct for no good reason. In the multi-threaded exec case where the thread group leader exits but the thread group remains the posix cpu timers just stop working when it should not.

To solve that problems requires checking if the target processes is still alive before proceeding. Replacing cpu.task with a struct pid pointer is the easiest way I can see to add that extra checking and extra indirection needed.

So here is my fix. Oleg, Thomas and if you guys could take a look and see I made any mistakes I would appreciate it.

Thomas if you want these changes you can have them otherwise I will take them through my tree.

Eric W. Biederman (5):
posix-cpu-timers: cpu_clock_sample_group no longer needs siglock
posix-cpu-timers: Remove unnecessary locking around cpu_clock_sample_group
posix-cpu-timers: Pass the task into arm_timer
posix-cpu-timers: Store a reference to a pid not a task
posix-cpu-timers: Stop disabling timers on mt-exec

 include/linux/posix-timers.h   |   2 +-
 kernel/exit.c                  |  11 +---
 kernel/time/posix-cpu-timers.c | 137 +++++++++++++++++++----------------------
 3 files changed, 67 insertions(+), 83 deletions(-)

Eric