Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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" <ebiederm@xmission.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/8736auvdt1.fsf@x220.int.ebiederm.org

authored by

Eric W. Biederman and committed by
Thomas Gleixner
beb41d9c 60f2ceaa

+3 -4
+3 -4
kernel/time/posix-cpu-timers.c
··· 482 482 * Insert the timer on the appropriate list before any timers that 483 483 * expire later. This must be called with the sighand lock held. 484 484 */ 485 - static void arm_timer(struct k_itimer *timer) 485 + static void arm_timer(struct k_itimer *timer, struct task_struct *p) 486 486 { 487 487 int clkidx = CPUCLOCK_WHICH(timer->it_clock); 488 488 struct cpu_timer *ctmr = &timer->it.cpu; 489 489 u64 newexp = cpu_timer_getexpires(ctmr); 490 - struct task_struct *p = ctmr->task; 491 490 struct posix_cputimer_base *base; 492 491 493 492 if (CPUCLOCK_PERTHREAD(timer->it_clock)) ··· 659 660 */ 660 661 cpu_timer_setexpires(ctmr, new_expires); 661 662 if (new_expires != 0 && val < new_expires) { 662 - arm_timer(timer); 663 + arm_timer(timer, p); 663 664 } 664 665 665 666 unlock_task_sighand(p, &flags); ··· 979 980 /* 980 981 * Now re-arm for the new expiry time. 981 982 */ 982 - arm_timer(timer); 983 + arm_timer(timer, p); 983 984 unlock_task_sighand(p, &flags); 984 985 } 985 986