Skip to content

Commit beb41d9

Browse files
ebiedermKAGA-KOKO
authored andcommitted
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: "Eric W. Biederman" <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 60f2cea commit beb41d9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

kernel/time/posix-cpu-timers.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,11 @@ void posix_cpu_timers_exit_group(struct task_struct *tsk)
482482
* Insert the timer on the appropriate list before any timers that
483483
* expire later. This must be called with the sighand lock held.
484484
*/
485-
static void arm_timer(struct k_itimer *timer)
485+
static void arm_timer(struct k_itimer *timer, struct task_struct *p)
486486
{
487487
int clkidx = CPUCLOCK_WHICH(timer->it_clock);
488488
struct cpu_timer *ctmr = &timer->it.cpu;
489489
u64 newexp = cpu_timer_getexpires(ctmr);
490-
struct task_struct *p = ctmr->task;
491490
struct posix_cputimer_base *base;
492491

493492
if (CPUCLOCK_PERTHREAD(timer->it_clock))
@@ -660,7 +659,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags,
660659
*/
661660
cpu_timer_setexpires(ctmr, new_expires);
662661
if (new_expires != 0 && val < new_expires) {
663-
arm_timer(timer);
662+
arm_timer(timer, p);
664663
}
665664

666665
unlock_task_sighand(p, &flags);
@@ -980,7 +979,7 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer)
980979
/*
981980
* Now re-arm for the new expiry time.
982981
*/
983-
arm_timer(timer);
982+
arm_timer(timer, p);
984983
unlock_task_sighand(p, &flags);
985984
}
986985

0 commit comments

Comments
 (0)