Commit beb41d9c authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Thomas Gleixner

posix-cpu-timers: Pass the task into arm_timer()

The task has been already computed to take siglock before calling
arm_timer. So pass the benefit of that labor into arm_timer().
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/8736auvdt1.fsf@x220.int.ebiederm.org
parent 60f2ceaa
...@@ -482,12 +482,11 @@ void posix_cpu_timers_exit_group(struct task_struct *tsk) ...@@ -482,12 +482,11 @@ void posix_cpu_timers_exit_group(struct task_struct *tsk)
* Insert the timer on the appropriate list before any timers that * Insert the timer on the appropriate list before any timers that
* expire later. This must be called with the sighand lock held. * expire later. This must be called with the sighand lock held.
*/ */
static void arm_timer(struct k_itimer *timer) static void arm_timer(struct k_itimer *timer, struct task_struct *p)
{ {
int clkidx = CPUCLOCK_WHICH(timer->it_clock); int clkidx = CPUCLOCK_WHICH(timer->it_clock);
struct cpu_timer *ctmr = &timer->it.cpu; struct cpu_timer *ctmr = &timer->it.cpu;
u64 newexp = cpu_timer_getexpires(ctmr); u64 newexp = cpu_timer_getexpires(ctmr);
struct task_struct *p = ctmr->task;
struct posix_cputimer_base *base; struct posix_cputimer_base *base;
if (CPUCLOCK_PERTHREAD(timer->it_clock)) if (CPUCLOCK_PERTHREAD(timer->it_clock))
...@@ -660,7 +659,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, ...@@ -660,7 +659,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
*/ */
cpu_timer_setexpires(ctmr, new_expires); cpu_timer_setexpires(ctmr, new_expires);
if (new_expires != 0 && val < new_expires) { if (new_expires != 0 && val < new_expires) {
arm_timer(timer); arm_timer(timer, p);
} }
unlock_task_sighand(p, &flags); unlock_task_sighand(p, &flags);
...@@ -980,7 +979,7 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer) ...@@ -980,7 +979,7 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
/* /*
* Now re-arm for the new expiry time. * Now re-arm for the new expiry time.
*/ */
arm_timer(timer); arm_timer(timer, p);
unlock_task_sighand(p, &flags); unlock_task_sighand(p, &flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment