lkml.org 
[lkml]   [2020]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/2] nohz: try to avoid IPI when setting tick dependency for task
When enabling per-CPU posix timers, an IPI to nohz_full CPUs might be
performed (to re-read the dependencies and possibly not re-enter
nohz_full on a given CPU).

A common case is for applications that run on nohz_full= CPUs
to not use POSIX timers (eg DPDK).

This patch optimizes tick_nohz_dep_set_task to avoid kicking
all nohz_full= CPUs in case the task allowed mask does not
intersect with nohz_full= CPU mask,
when going through tick_nohz_dep_set_task.

This reduces interruptions to nohz_full= CPUs.

---
kernel/time/tick-sched.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/time/tick-sched.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-sched.c
+++ linux-2.6/kernel/time/tick-sched.c
@@ -383,11 +383,16 @@ void tick_nohz_dep_set_task(struct task_
tick_nohz_full_kick();
preempt_enable();
} else {
+ unsigned long flags;
+
/*
* Some future tick_nohz_full_kick_task()
- * should optimize this.
+ * should further optimize this.
*/
- tick_nohz_full_kick_all();
+ raw_spin_lock_irqsave(&tsk->pi_lock, flags);
+ if (cpumask_intersects(&tsk->cpus_mask, tick_nohz_full_mask))
+ tick_nohz_full_kick_all();
+ raw_spin_unlock_irqrestore(&tsk->pi_lock, flags);
}
}
}

\
 
 \ /
  Last update: 2020-08-25 20:47    [W:0.114 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site