Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757985Ab0LTP0Q (ORCPT ); Mon, 20 Dec 2010 10:26:16 -0500 Received: from mail-fx0-f43.google.com ([209.85.161.43]:63472 "EHLO mail-fx0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757998Ab0LTPY7 (ORCPT ); Mon, 20 Dec 2010 10:24:59 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=rN8OXnV1gI+M4odNAOx1+/nFTerFOWoJ2EU9gAY3fcm8hk9zZn+IR1e/V3gXIofB8b RnYvXRmWZpiRxw09Rl37ODLJTAXxvMIsvU3IFeluTIeWVBKjY1eDyzTrjgW3zMFzaM52 40g/VQzZMDmR+8w5FBcROXEYayMXtnlwTa/aE= From: Frederic Weisbecker To: LKML Cc: LKML , Frederic Weisbecker , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Ingo Molnar , Steven Rostedt , Lai Jiangshan , Andrew Morton , Anton Blanchard , Tim Pepper Subject: [RFC PATCH 12/15] clocksource: Ignore nohz task cpu in clocksource watchdog Date: Mon, 20 Dec 2010 16:24:19 +0100 Message-Id: <1292858662-5650-13-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1292858662-5650-1-git-send-email-fweisbec@gmail.com> References: <1292858662-5650-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1806 Lines: 50 The watchdog should probably make an exception for nohz task cpus that want to be interrupted the least possible. However we probably need to warn the user about that. Another solution would be to make this timer defferable. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Paul E. McKenney Cc: Ingo Molnar Cc: Steven Rostedt Cc: Lai Jiangshan Cc: Andrew Morton Cc: Anton Blanchard Cc: Tim Pepper --- kernel/time/clocksource.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index c18d7ef..9e62a97 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -302,9 +302,13 @@ static void clocksource_watchdog(unsigned long data) * Cycle through CPUs to check if the CPUs stay synchronized * to each other. */ - next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask); - if (next_cpu >= nr_cpu_ids) - next_cpu = cpumask_first(cpu_online_mask); + next_cpu = raw_smp_processor_id(); + do { + next_cpu = cpumask_next(next_cpu, cpu_online_mask); + if (next_cpu >= nr_cpu_ids) + next_cpu = cpumask_first(cpu_online_mask); + } while (cpu_has_nohz_task(next_cpu)); + watchdog_timer.expires += WATCHDOG_INTERVAL; add_timer_on(&watchdog_timer, next_cpu); out: -- 1.7.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/