From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752906AbbDBSdZ (ORCPT ); Thu, 2 Apr 2015 14:33:25 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:47466 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbbDBSdW (ORCPT ); Thu, 2 Apr 2015 14:33:22 -0400 Date: Thu, 2 Apr 2015 20:33:08 +0200 From: Peter Zijlstra To: Chris Metcalf Cc: Frederic Weisbecker , Don Zickus , Ingo Molnar , Andrew Morton , Andrew Jones , chai wen , Ulrich Obergfell , Fabian Frederick , Aaron Tomlin , Ben Zhang , Christoph Lameter , Gilad Ben-Yossef , Steven Rostedt , linux-kernel@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [PATCH v3] watchdog: add watchdog_cpumask sysctl to assist nohz Message-ID: <20150402183308.GB27490@worktop.programming.kicks-ass.net> References: <551AE7D4.3020608@ezchip.com> <20150402133502.GA175361@redhat.com> <551D48F9.6090101@ezchip.com> <20150402141527.GD175361@redhat.com> <20150402153827.GC10357@lerouge> <551D6373.2030000@ezchip.com> <20150402164845.GD10357@lerouge> <1427996368-2199-1-git-send-email-cmetcalf@ezchip.com> <20150402180626.GG23123@twins.programming.kicks-ass.net> <551D8769.5030100@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551D8769.5030100@ezchip.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2015 at 02:16:09PM -0400, Chris Metcalf wrote: > On 04/02/2015 02:06 PM, Peter Zijlstra wrote: > >On Thu, Apr 02, 2015 at 01:39:28PM -0400, cmetcalf@ezchip.com wrote: > >>@@ -431,6 +434,10 @@ static void watchdog_enable(unsigned int cpu) > >> 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)) > >>+ do_exit(0); > >>+ > >Ick, that doesn't look right for smpboot threads. > > 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? What's wrong with just leaving the thread be but making sure it'll never actually do anything?