diff options
author | Michel Lespinasse <[email protected]> | 2010-08-09 17:21:19 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2010-08-09 20:45:11 -0700 |
commit | 424acaaeb3a3932d64a9b4bd59df6cf72c22d8f3 (patch) | |
tree | c3c55028aa6eff578bc6d4d984796c7ea1379061 /tools/perf/util/trace-event-scripting.c | |
parent | fd41b33435ada87323cc86b50959fbffe35192c8 (diff) |
rwsem: wake queued readers when writer blocks on active read lock
This change addresses the following situation:
- Thread A acquires the rwsem for read
- Thread B tries to acquire the rwsem for write, notices there is already
an active owner for the rwsem.
- Thread C tries to acquire the rwsem for read, notices that thread B already
tried to acquire it.
- Thread C grabs the spinlock and queues itself on the wait queue.
- Thread B grabs the spinlock and queues itself behind C. At this point A is
the only remaining active owner on the rwsem.
In this situation thread B could notice that it was the last active writer
on the rwsem, and decide to wake C to let it proceed in parallel with A
since they both only want the rwsem for read.
Signed-off-by: Michel Lespinasse <[email protected]>
Acked-by: David Howells <[email protected]>
Cc: Mike Waychison <[email protected]>
Cc: Suleiman Souhlal <[email protected]>
Cc: Ying Han <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions