sched/cpusets fixes, more changes are needed
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 24 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | kill the broken and deadlockable cpuset_lock/cpuset_cpus_allowed_locked codeinclude/ kernel/ kernel/ | +4 | 5 replies | |
| 2/6 | move_task_off_dead_cpu: take rq->lock around select_fallback_rq()kernel/ | +15 | 6 replies | |
| 3/6 | move_task_off_dead_cpu: remove retry logickernel/ | +6 | 1 reply | |
| 4/6 | sched_exec: remove select_fallback_rq() logickernel/ | +8 | 1 reply | |
| 5/6 | _cpu_down: don't play with current->cpus_allowedinclude/ kernel/ kernel/ | +8 | 2 replies | |
| 6/6 | make select_fallback_rq() cpuset friendlyinclude/ kernel/ kernel/ | +50 | 1 reply |
Reviews trailers per patch
1 of 6 patches has a Reviewed-by or Acked-by.
| Patch | Rafael J. Wysocki |
|---|---|
| 1/6 | |
| 2/6 | |
| 3/6 | |
| 4/6 | |
| 5/6 | A-b A-b |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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.