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.

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Thomas Gleixner:
"Fix a potential deadlock versus hrtimers"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched: Fix HRTICK

+11 -9
+11 -9
kernel/sched/core.c
··· 370 370 #ifdef CONFIG_SCHED_HRTICK 371 371 /* 372 372 * Use HR-timers to deliver accurate preemption points. 373 - * 374 - * Its all a bit involved since we cannot program an hrt while holding the 375 - * rq->lock. So what we do is store a state in in rq->hrtick_* and ask for a 376 - * reschedule event. 377 - * 378 - * When we get rescheduled we reprogram the hrtick_timer outside of the 379 - * rq->lock. 380 373 */ 381 374 382 375 static void hrtick_clear(struct rq *rq) ··· 397 404 } 398 405 399 406 #ifdef CONFIG_SMP 407 + 408 + static int __hrtick_restart(struct rq *rq) 409 + { 410 + struct hrtimer *timer = &rq->hrtick_timer; 411 + ktime_t time = hrtimer_get_softexpires(timer); 412 + 413 + return __hrtimer_start_range_ns(timer, time, 0, HRTIMER_MODE_ABS_PINNED, 0); 414 + } 415 + 400 416 /* 401 417 * called from hardirq (IPI) context 402 418 */ ··· 414 412 struct rq *rq = arg; 415 413 416 414 raw_spin_lock(&rq->lock); 417 - hrtimer_restart(&rq->hrtick_timer); 415 + __hrtick_restart(rq); 418 416 rq->hrtick_csd_pending = 0; 419 417 raw_spin_unlock(&rq->lock); 420 418 } ··· 432 430 hrtimer_set_expires(timer, time); 433 431 434 432 if (rq == this_rq()) { 435 - hrtimer_restart(timer); 433 + __hrtick_restart(rq); 436 434 } else if (!rq->hrtick_csd_pending) { 437 435 __smp_call_function_single(cpu_of(rq), &rq->hrtick_csd, 0); 438 436 rq->hrtick_csd_pending = 1;