History

tick/nohz: Call tick_nohz_task_switch() with interrupts disabled

Call tick_nohz_task_switch() slightly earlier after the context switch to benefit from disabled IRQs. This way the function doesn't need to disable them once more.

Peter Zijlstra committed 5 years ago

Commit 0fdcccf1 parent a1dfb632 files · +2 −7Browse files

Showing the changes to kernel (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/sched/core.c +1 −1
  2. kernel/time/tick-sched.c +1 −6
kernel/sched/core.c+1−1
@@ -4212,6 +4212,7 @@ static struct rq *finish_task_switch(struct task_struct *prev) · 4211 unmodified lines
42124212 vtime_task_switch(prev);
42134213 perf_event_task_sched_in(prev, current);
42144214 finish_task(prev);
4215+ tick_nohz_task_switch();
42154216 finish_lock_switch(rq);
42164217 finish_arch_post_lock_switch();
42174218 kcov_finish_switch(current);
@@ -4257,7 +4258,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) · 39 unmodified lines
42574258 put_task_struct_rcu_user(prev);
42584259 }
42594260
4260− tick_nohz_task_switch();
42614261 return rq;
42624262 }
42634263
kernel/time/tick-sched.c+1−6
@@ -487,13 +487,10 @@ void tick_nohz_dep_clear_signal(struct signal_struct *sig, enum tick_dep_bits bi · 486 unmodified lines
487487 */
488488 void __tick_nohz_task_switch(void)
489489 {
490− unsigned long flags;
491490 struct tick_sched *ts;
492491
493− local_irq_save(flags);
494−
495492 if (!tick_nohz_full_cpu(smp_processor_id()))
496− goto out;
493+ return;
497494
498495 ts = this_cpu_ptr(&tick_cpu_sched);
499496
@@ -502,8 +499,6 @@ void __tick_nohz_task_switch(void) · 2 unmodified lines
502499 atomic_read(&current->signal->tick_dep_mask))
503500 tick_nohz_full_kick();
504501 }
505−out:
506− local_irq_restore(flags);
507502 }
508503
509504 /* Get the boot-time nohz CPU list from the kernel parameters. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t