[lkml]   [2014]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH 29/38] tick-sched: remove wrapper around __tick_nohz_task_switch()
On 15 April 2014 18:14, Frederic Weisbecker <> wrote:
> Sure but check out the static_key_false() in the implementation of tick_nohz_full_enabled().
> That's where the magic hides.

> No problem, the jump label/static key code is quite tricky. And its use
> can be easily missed, as in here.
> Also its unfamous API naming (static_key_true/static_key_true) that is
> anything but intuitive.

That was tricky enough to be missed on first look :)

Okay here is the answer to what you asked earlier:

>> In this case probably we can move !can_stop_full_tick() as well to the wrapper ?
> Do you mean moving all the code of __tick_nohz_task_switch() to tick_nohz_task_switch()?
> I much prefer we don't do that. This is going to make can_stop_full_tick() a publicly
> visible nohz internal. And it may uglify tick.h as well.

I probably asked the wrong question, I meant tick_nohz_tick_stopped()
instead of !can_stop_full_tick().

Or, can we make the code more efficient by avoiding a branch by doing this:

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 1065a51..12632cc 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -220,7 +220,7 @@ static inline void tick_nohz_full_check(void)

static inline void tick_nohz_task_switch(void)
- if (tick_nohz_full_enabled())
+ if (tick_nohz_full_enabled() && tick_nohz_tick_stopped())

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 45037c4..904e09b 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -273,7 +273,7 @@ void __tick_nohz_task_switch(void)


- if (tick_nohz_tick_stopped() && !can_stop_full_tick())
+ if (!can_stop_full_tick())


 \ /
  Last update: 2014-04-16 08:01    [W:0.088 / U:11.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site