Re: [PATCH v3] watchdog: add watchdog_cpumask sysctl to assist nohz
From: Chris Metcalf
Date: Thu Apr 02 2015 - 14:16:34 EST
On 04/02/2015 02:06 PM, Peter Zijlstra wrote:
On Thu, Apr 02, 2015 at 01:39:28PM -0400, cmetcalf@xxxxxxxxxx wrote:
@@ -431,6 +434,10 @@ static void watchdog_enable(unsigned int cpu)
Ick, that doesn't look right for smpboot threads.
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer->function = watchdog_timer_fn;
+ /* Exit if the cpu is not allowed for watchdog. */
+ if (!cpumask_test_cpu(cpu, watchdog_mask))
I didn't see a better way to make this happen without adding
a bunch of infrastructure to the smpboot thread mechanism
to use a cpumask other than for_each_online_cpu(). The exit
seems benign in my testing, but I agree it's not the cleanest
way to express what we're trying to do here.
Perhaps something like an optional cpumask_t pointer in
struct smp_hotplug_thread, which if present specifies the
cpus to run on, and otherwise we stick with cpu_online_mask?
Chris Metcalf, EZChip Semiconductor
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/