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 fixes from Ingo Molnar:
"Misc fixes: cputime fixes, two deadline scheduler fixes and a cgroups
scheduling fix"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/cputime: Fix omitted ticks passed in parameter
sched/cputime: Fix steal time accounting
sched/deadline: Fix lock pinning warning during CPU hotplug
sched/cputime: Mitigate performance regression in times()/clock_gettime()
sched/fair: Fix typo in sync_throttle()
sched/deadline: Fix wrap-around in DL heap

+34 -4
+19
kernel/sched/core.c
··· 74 74 #include <linux/context_tracking.h> 75 75 #include <linux/compiler.h> 76 76 #include <linux/frame.h> 77 + #include <linux/prefetch.h> 77 78 78 79 #include <asm/switch_to.h> 79 80 #include <asm/tlb.h> ··· 2973 2972 EXPORT_PER_CPU_SYMBOL(kernel_cpustat); 2974 2973 2975 2974 /* 2975 + * The function fair_sched_class.update_curr accesses the struct curr 2976 + * and its field curr->exec_start; when called from task_sched_runtime(), 2977 + * we observe a high rate of cache misses in practice. 2978 + * Prefetching this data results in improved performance. 2979 + */ 2980 + static inline void prefetch_curr_exec_start(struct task_struct *p) 2981 + { 2982 + #ifdef CONFIG_FAIR_GROUP_SCHED 2983 + struct sched_entity *curr = (&p->se)->cfs_rq->curr; 2984 + #else 2985 + struct sched_entity *curr = (&task_rq(p)->cfs)->curr; 2986 + #endif 2987 + prefetch(curr); 2988 + prefetch(&curr->exec_start); 2989 + } 2990 + 2991 + /* 2976 2992 * Return accounted runtime for the task. 2977 2993 * In case the task is currently running, return the runtime plus current's 2978 2994 * pending runtime that have not been accounted yet. ··· 3023 3005 * thread, breaking clock_gettime(). 3024 3006 */ 3025 3007 if (task_current(rq, p) && task_on_rq_queued(p)) { 3008 + prefetch_curr_exec_start(p); 3026 3009 update_rq_clock(rq); 3027 3010 p->sched_class->update_curr(rq); 3028 3011 }
+1 -1
kernel/sched/cpudeadline.c
··· 168 168 169 169 if (old_idx == IDX_INVALID) { 170 170 cp->size++; 171 - cp->elements[cp->size - 1].dl = 0; 171 + cp->elements[cp->size - 1].dl = dl; 172 172 cp->elements[cp->size - 1].cpu = cpu; 173 173 cp->elements[cpu].idx = cp->size - 1; 174 174 cpudl_change_key(cp, cp->size - 1, dl);
+9 -1
kernel/sched/cputime.c
··· 508 508 */ 509 509 void account_idle_ticks(unsigned long ticks) 510 510 { 511 + cputime_t cputime, steal; 511 512 512 513 if (sched_clock_irqtime) { 513 514 irqtime_account_idle_ticks(ticks); 514 515 return; 515 516 } 516 517 517 - account_idle_time(jiffies_to_cputime(ticks)); 518 + cputime = jiffies_to_cputime(ticks); 519 + steal = steal_account_process_time(cputime); 520 + 521 + if (steal >= cputime) 522 + return; 523 + 524 + cputime -= steal; 525 + account_idle_time(cputime); 518 526 } 519 527 520 528 /*
+4 -1
kernel/sched/deadline.c
··· 658 658 * 659 659 * XXX figure out if select_task_rq_dl() deals with offline cpus. 660 660 */ 661 - if (unlikely(!rq->online)) 661 + if (unlikely(!rq->online)) { 662 + lockdep_unpin_lock(&rq->lock, rf.cookie); 662 663 rq = dl_task_offline_migration(rq, p); 664 + rf.cookie = lockdep_pin_lock(&rq->lock); 665 + } 663 666 664 667 /* 665 668 * Queueing this task back might have overloaded rq, check if we need
+1 -1
kernel/sched/fair.c
··· 4269 4269 pcfs_rq = tg->parent->cfs_rq[cpu]; 4270 4270 4271 4271 cfs_rq->throttle_count = pcfs_rq->throttle_count; 4272 - pcfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu)); 4272 + cfs_rq->throttled_clock_task = rq_clock_task(cpu_rq(cpu)); 4273 4273 } 4274 4274 4275 4275 /* conditionally throttle active cfs_rq's from put_prev_entity() */