diff options
author | 2021-03-03 16:45:41 +0100 | |
---|---|---|
committer | 2021-05-12 11:43:27 +0200 | |
commit | 9ef7e7e33bcdb57be1afb28884053c28b5f05240 (patch) | |
tree | 40e43fa4c6d82adf7cd39fbc1f5dfb868701165b /kernel/sched/deadline.c | |
parent | sched: Core-wide rq->lock (diff) | |
download | linux-9ef7e7e33bcdb57be1afb28884053c28b5f05240.tar.gz linux-9ef7e7e33bcdb57be1afb28884053c28b5f05240.tar.bz2 linux-9ef7e7e33bcdb57be1afb28884053c28b5f05240.zip |
sched: Optimize rq_lockp() usage
rq_lockp() includes a static_branch(), which is asm-goto, which is
asm volatile which defeats regular CSE. This means that:
if (!static_branch(&foo))
return simple;
if (static_branch(&foo) && cond)
return complex;
Doesn't fold and we get horrible code. Introduce __rq_lockp() without
the static_branch() on.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Don Hiatt <dhiatt@digitalocean.com>
Tested-by: Hongyu Ning <hongyu.ning@linux.intel.com>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20210422123308.316696988@infradead.org
Diffstat (limited to 'kernel/sched/deadline.c')
-rw-r--r-- | kernel/sched/deadline.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 6e99b8b37c8c..fb0eb9a19fc7 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1097,9 +1097,9 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) * If the runqueue is no longer available, migrate the * task elsewhere. This necessarily changes rq. */ - lockdep_unpin_lock(rq_lockp(rq), rf.cookie); + lockdep_unpin_lock(__rq_lockp(rq), rf.cookie); rq = dl_task_offline_migration(rq, p); - rf.cookie = lockdep_pin_lock(rq_lockp(rq)); + rf.cookie = lockdep_pin_lock(__rq_lockp(rq)); update_rq_clock(rq); /* |