diff options
author | Davidlohr Bueso <[email protected]> | 2015-02-01 22:16:24 -0800 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2015-02-04 07:57:42 +0100 |
commit | afffc6c1805d98e08e778cddb644a666e78cfcfd (patch) | |
tree | 86ad29607790194934447f45787de73314bd5397 /net/switchdev/switchdev.c | |
parent | 73105994c57d06e40a33ab5a716db04e898b4c05 (diff) |
locking/rtmutex: Optimize setting task running after being blocked
We explicitly mark the task running after returning from
a __rt_mutex_slowlock() call, which does the actual sleeping
via wait-wake-trylocking. As such, this patch does two things:
(1) refactors the code so that setting current to TASK_RUNNING
is done by __rt_mutex_slowlock(), and not by the callers. The
downside to this is that it becomes a bit unclear when at what
point we block. As such I've added a comment that the task
blocks when calling __rt_mutex_slowlock() so readers can figure
out when it is running again.
(2) relaxes setting current's state through __set_current_state(),
instead of it's more expensive barrier alternative. There was no
need for the implied barrier as we're obviously not planning on
blocking.
Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions