mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
posix-cpu-timers: Split run_posix_cpu_timers()
Split it up as a preparatory step to move the heavy lifting out of interrupt context. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20200730102337.677439437@linutronix.de
This commit is contained in:
parent
4da9f33026
commit
820903c784
1 changed files with 24 additions and 19 deletions
|
@ -1080,32 +1080,15 @@ static inline bool fastpath_timer_check(struct task_struct *tsk)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static void __run_posix_cpu_timers(struct task_struct *tsk)
|
||||||
* This is called from the timer interrupt handler. The irq handler has
|
|
||||||
* already updated our counts. We need to check if any timers fire now.
|
|
||||||
* Interrupts are disabled.
|
|
||||||
*/
|
|
||||||
void run_posix_cpu_timers(void)
|
|
||||||
{
|
{
|
||||||
struct task_struct *tsk = current;
|
|
||||||
struct k_itimer *timer, *next;
|
struct k_itimer *timer, *next;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
LIST_HEAD(firing);
|
LIST_HEAD(firing);
|
||||||
|
|
||||||
lockdep_assert_irqs_disabled();
|
if (!lock_task_sighand(tsk, &flags))
|
||||||
|
|
||||||
/*
|
|
||||||
* The fast path checks that there are no expired thread or thread
|
|
||||||
* group timers. If that's so, just return.
|
|
||||||
*/
|
|
||||||
if (!fastpath_timer_check(tsk))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lockdep_posixtimer_enter();
|
|
||||||
if (!lock_task_sighand(tsk, &flags)) {
|
|
||||||
lockdep_posixtimer_exit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Here we take off tsk->signal->cpu_timers[N] and
|
* Here we take off tsk->signal->cpu_timers[N] and
|
||||||
* tsk->cpu_timers[N] all the timers that are firing, and
|
* tsk->cpu_timers[N] all the timers that are firing, and
|
||||||
|
@ -1147,6 +1130,28 @@ void run_posix_cpu_timers(void)
|
||||||
cpu_timer_fire(timer);
|
cpu_timer_fire(timer);
|
||||||
spin_unlock(&timer->it_lock);
|
spin_unlock(&timer->it_lock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is called from the timer interrupt handler. The irq handler has
|
||||||
|
* already updated our counts. We need to check if any timers fire now.
|
||||||
|
* Interrupts are disabled.
|
||||||
|
*/
|
||||||
|
void run_posix_cpu_timers(void)
|
||||||
|
{
|
||||||
|
struct task_struct *tsk = current;
|
||||||
|
|
||||||
|
lockdep_assert_irqs_disabled();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The fast path checks that there are no expired thread or thread
|
||||||
|
* group timers. If that's so, just return.
|
||||||
|
*/
|
||||||
|
if (!fastpath_timer_check(tsk))
|
||||||
|
return;
|
||||||
|
|
||||||
|
lockdep_posixtimer_enter();
|
||||||
|
__run_posix_cpu_timers(tsk);
|
||||||
lockdep_posixtimer_exit();
|
lockdep_posixtimer_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue