lkml.org 
[lkml]   [2021]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] timer: Use static_branch_likely() for timers_nohz_active
NOHZ is likely to be enabled, so use static_branch_likely() to
reflect this fact. This could improve the finally generated code
a bit for the most likely scenario, I.E save two "jmp" instructions.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
kernel/time/timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index d111adf4a0cb..40d4fe7fa207 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -265,7 +265,7 @@ int timer_migration_handler(struct ctl_table *table, int write,

static inline bool is_timers_nohz_active(void)
{
- return static_branch_unlikely(&timers_nohz_active);
+ return static_branch_likely(&timers_nohz_active);
}
#else
static inline bool is_timers_nohz_active(void) { return false; }
--
2.31.0
\
 
 \ /
  Last update: 2021-05-13 08:34    [W:0.062 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site