Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372926
b: refs/heads/master
c: 99e5ada
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Apr 22, 2013
1 parent 88531df commit 2c6ee50
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5811d9963e26146898a24b535b301f7654257f8a
refs/heads/master: 99e5ada9407cc19d7c4c05ce2165f20dc46fc093
2 changes: 2 additions & 0 deletions trunk/include/linux/tick.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@ extern int tick_nohz_full_cpu(int cpu);
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(struct task_struct *tsk);
#else
static inline void tick_nohz_init(void) { }
static inline int tick_nohz_full_cpu(int cpu) { return 0; }
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(struct task_struct *tsk) { }
#endif


Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,8 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
kprobe_flush_task(prev);
put_task_struct(prev);
}

tick_nohz_task_switch(current);
}

#ifdef CONFIG_SMP
Expand Down
20 changes: 20 additions & 0 deletions trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,26 @@ void tick_nohz_full_kick_all(void)
preempt_enable();
}

/*
* Re-evaluate the need for the tick as we switch the current task.
* It might need the tick due to per task/process properties:
* perf events, posix cpu timers, ...
*/
void tick_nohz_task_switch(struct task_struct *tsk)
{
unsigned long flags;

if (!tick_nohz_full_cpu(smp_processor_id()))
return;

local_irq_save(flags);

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

local_irq_restore(flags);
}

int tick_nohz_full_cpu(int cpu)
{
if (!have_nohz_full_mask)
Expand Down

0 comments on commit 2c6ee50

Please sign in to comment.