lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 29/38] tick-sched: remove wrapper around __tick_nohz_task_switch()
Date
__tick_nohz_task_switch() was called only from tick_nohz_task_switch() and there
is nothing much in tick_nohz_task_switch() as well. IOW, we don't need
unnecessary wrapper over __tick_nohz_task_switch() to be there. Merge all code
from __tick_nohz_task_switch() into tick_nohz_task_switch() and move it to
tick-sched.c.

This also moves check for tick_nohz_tick_stopped() outside of irq_save()
context.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
include/linux/tick.h | 11 ++---------
kernel/time/tick-sched.c | 7 +++++--
2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/include/linux/tick.h b/include/linux/tick.h
index 1065a51..585be84 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -201,7 +201,7 @@ extern void tick_nohz_init(void);
extern void __tick_nohz_full_check(void);
extern void tick_nohz_full_kick(void);
extern void tick_nohz_full_kick_all(void);
-extern void __tick_nohz_task_switch(void);
+extern void tick_nohz_task_switch(void);
#else
static inline void tick_nohz_init(void) { }
static inline bool tick_nohz_full_enabled(void) { return false; }
@@ -209,7 +209,7 @@ static inline bool tick_nohz_full_cpu(int cpu) { return false; }
static inline void __tick_nohz_full_check(void) { }
static inline void tick_nohz_full_kick(void) { }
static inline void tick_nohz_full_kick_all(void) { }
-static inline void __tick_nohz_task_switch(void) { }
+static inline void tick_nohz_task_switch(void) { }
#endif

static inline void tick_nohz_full_check(void)
@@ -218,11 +218,4 @@ static inline void tick_nohz_full_check(void)
__tick_nohz_full_check();
}

-static inline void tick_nohz_task_switch(void)
-{
- if (tick_nohz_full_enabled())
- __tick_nohz_task_switch();
-}
-
-
#endif
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 5f7796d..d8b9a69 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -266,13 +266,16 @@ void tick_nohz_full_kick_all(void)
* It might need the tick due to per task/process properties:
* perf events, posix cpu timers, ...
*/
-void __tick_nohz_task_switch(void)
+void tick_nohz_task_switch(void)
{
unsigned long flags;

+ if (!tick_nohz_full_enabled() || !tick_nohz_tick_stopped())
+ return;
+
local_irq_save(flags);

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

local_irq_restore(flags);
--
1.7.12.rc2.18.g61b472e


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