Skip to content

sched/cpusets fixes, more changes are needed

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked codeinclude/linux/cpuset.h kernel/cpuset.c kernel/sched.c+4 -465 replies
2/6move_task_off_dead_cpu: take rq->lock around select_fallback_rq()kernel/sched.c+15 -156 replies
3/6move_task_off_dead_cpu: remove retry logickernel/sched.c+6 -71 reply
4/6sched_exec: remove select_fallback_rq() logickernel/sched.c+8 -171 reply
5/6_cpu_down: don't play with current->cpus_allowedinclude/linux/sched.h kernel/cpu.c kernel/sched.c+8 -132 replies
6/6make select_fallback_rq() cpuset friendlyinclude/linux/cpuset.h kernel/cpuset.c kernel/sched.c+50 -31 reply

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchRafael J. Wysocki
1/6
2/6
3/6
4/6
5/6A-b A-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] sched/cpusets fixes, more changes are needed

Ingo, Peter.

Unless I missed something, with or without these patches the TASK_WAKING logic in do_fork() is very broken.

- do_fork() clears PF_STARTING and then calls wake_up_new_task() which finally does s/WAKING/RUNNING.

But. Nobody can take rq->lock in between. This means a signal from irq (quite possible with CLONE_THREAD) or another rt thread which preempts us can lockup.

- the comment in wake_up_new_task says:

We still have TASK_WAKING but PF_STARTING is gone now, meaning ->cpus_allowed is stable

this is not true. Yes, nobody can take rq->lock _after_ we cleared PF_STARTING, but it is possible that another thread took this lock before and still holds it doing, say, sched_setaffinity().

No?

If yes. I can make a patch, but the question is: what is the point to use TASK_WAKING in fork pathes? Can't sched_fork() set TASK_RUNNING instead? Afaics, TASK_RUNNING can equally protect from premature wakeups but doesn't these PF_STARTING complications.

As for this series. Please review. I don't understand how it is possible to really test these changes.

Dear cpuset developers! Please review ;) If you don't like 6/6, please make a better fix. I tried to make as "simple" patch as possible because I hardly understand cpuset.c, last time I quickly read it a long ago.

Oleg.