Thread (38 messages) 38 messages, 7 authors, 2016-08-15

Re: clocksource_watchdog causing scheduling of timers every second (was [v13] support "task_isolation" mode)

flat view

From: Chris Metcalf <hidden>
Date: 2016-07-27 20:04:50
Also in: lkml

On 7/27/2016 2:56 PM, Christoph Lameter wrote:
quoted hunk ↗ jump to hunk
On Wed, 27 Jul 2016, Chris Metcalf wrote:
quoted
How about using cpumask_next_and(raw_smp_processor_id(), cpu_online_mask,
housekeeping_cpumask()), likewise cpumask_first_and()?  Does that work?
Ok here is V2:


Subject: clocksource: Do not schedule watchdog on isolated or NOHZ cpus V2

watchdog checks can only run on housekeeping capable cpus. Otherwise
we will be generating noise that we would like to avoid on the isolated
processors.

Signed-off-by: Christoph Lameter <redacted>

Index: linux/kernel/time/clocksource.c
===================================================================
--- linux.orig/kernel/time/clocksource.c
+++ linux/kernel/time/clocksource.c
@@ -269,9 +269,10 @@ static void clocksource_watchdog(unsigne
  	 * Cycle through CPUs to check if the CPUs stay synchronized
  	 * to each other.
  	 */
-	next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
+	next_cpu = cpumask_next_and(raw_smp_processor_id(), cpu_online_mask, housekeeping_cpumask());
  	if (next_cpu >= nr_cpu_ids)
-		next_cpu = cpumask_first(cpu_online_mask);
+		next_cpu = cpumask_first_and(cpu_online_mask, housekeeping_cpumask());
+
  	watchdog_timer.expires += WATCHDOG_INTERVAL;
  	add_timer_on(&watchdog_timer, next_cpu);
  out:
Looks good.  Did you omit the equivalent fix in clocksource_start_watchdog()
on purpose?  For now I just took your change, but tweaked it to add the
equivalent diff with cpumask_first_and() there.

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help