Skip to content

rwsem-rt: Make rwsem rt closer to mainline

Steven Rostedt linux-rt-users lkml 1 version Applied

Status from this message: Applied

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2rwsem-rt: Do not allow readers to nestinclude/linux/rwsem_rt.h kernel/rt.c+8 -305 replies
2/2rtmutex: Remove duplicate rt_mutex_init()include/linux/rtmutex.h+3 -93 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH RT 0/2] rwsem-rt: Make rwsem rt closer to mainline

Looking at mainline's down_read() I noticed that reader locks of rwsems are not made to nest. In fact, they should not. Although, it may seem fine if a down_read() nests as multiple readers can have the lock, rwsems are fair locks. That is, if a writer were to block on a rwsem while readers have the lock, a new reader will also block. If a reader were to try to take the lock again while a writer was waiting, it would block, and cause a deadlock as it has the lock its trying to grab and wont let it go as the writer is waiting.

I also found that the rt_mutex_init() is identical in the two places it is defined in rtmutex.h.

Steven Rostedt (Red Hat) (2):
rwsem-rt: Do not allow readers to nest
rtmutex: Remove duplicate rt_mutex_init()

----

 include/linux/rtmutex.h  | 12 +++---------
 include/linux/rwsem_rt.h |  1 -
 kernel/rt.c              | 37 ++++++++-----------------------------
 3 files changed, 11 insertions(+), 39 deletions(-)