Skip to content

sched: Clean up might_sleep() and make it RT aware

Thomas Gleixner lkml 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 0 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/8sched: Clean up the might_sleep() underscore zooinclude/linux/kernel.h include/linux/sched.h kernel/locking/spinlock_rt.c +1 more+13 -130 replies
2/8sched: Make cond_resched_*lock() variants consistent vs. might_sleep()include/linux/sched.h+6 -60 replies
3/8sched: Remove preempt_offset argument from __might_sleep()include/linux/kernel.h kernel/sched/core.c mm/memory.c+6 -70 replies
4/8sched: Cleanup might_sleep() printkskernel/sched/core.c+6 -80 replies
5/8sched: Make might_sleep() output less confusingkernel/sched/core.c+22 -50 replies
6/8sched: Make RCU nest depth distinct in __might_resched()include/linux/kernel.h include/linux/sched.h kernel/sched/core.c+21 -140 replies
7/8sched: Make cond_resched_lock() variants RT awareinclude/linux/preempt.h include/linux/sched.h+28 -110 replies
8/8locking/rt: Take RCU nesting into account for __might_resched()kernel/locking/spinlock_rt.c+14 -30 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/8] sched: Clean up might_sleep() and make it RT aware

The might sleep checks have grown some warts over time and especially the underscore zoo is hard to follow.

Also the debug output is slightly confusing especially when PREEMPT_RCU is enabled as it does not provide information about the RCU nesting depth which might be the actual culprit. In such a case it might even print confusing information about the place which disabled preemption despite the fact that preemption is actually enabled.

RT in turn had it's own nasty hack to ignore RCU nesting depth because that's required for spin/rw lock held sections.

This series addresses this by:

- Cleaning up the underscore zoo

- Enhancing the debug output

- Making RCU nest depth and preempt count checks distinct

- Fixing up the relevant places to hand in the correct expected values for RT and !RT kernels.

The series is also available from

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git sched

Thanks,

tglx

---
 include/linux/kernel.h       |   13 +++-----
 include/linux/preempt.h      |    5 +--
 include/linux/sched.h        |   39 ++++++++++++++++++-------
 kernel/locking/spinlock_rt.c |   17 ++++++++--
 kernel/sched/core.c          |   67 +++++++++++++++++++++++++++----------------
 mm/memory.c                  |    2 -
 6 files changed, 96 insertions(+), 47 deletions(-)