From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689AbbDHUhe (ORCPT ); Wed, 8 Apr 2015 16:37:34 -0400 Received: from www.linutronix.de ([62.245.132.108]:44126 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbbDHUh3 (ORCPT ); Wed, 8 Apr 2015 16:37:29 -0400 Date: Wed, 8 Apr 2015 22:37:36 +0200 (CEST) From: Thomas Gleixner 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, Peter Zijlstra Subject: Re: [PATCH v6 1/2] smpboot: allow excluding cpus from the smpboot threads In-Reply-To: <1428520285-4609-1-git-send-email-cmetcalf@ezchip.com> Message-ID: References: <20150408140108.GB13227@lerouge> <1428520285-4609-1-git-send-email-cmetcalf@ezchip.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Apr 2015, cmetcalf@ezchip.com wrote: > @@ -173,6 +173,9 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) > if (tsk) > return 0; > > + if (ht->valid_cpu && !ht->valid_cpu(cpu)) > + return 0; > + > td = kzalloc_node(sizeof(*td), GFP_KERNEL, cpu_to_node(cpu)); > if (!td) > return -ENOMEM; > @@ -221,9 +224,11 @@ static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cp > { > struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); > > - if (ht->pre_unpark) > - ht->pre_unpark(cpu); > - kthread_unpark(tsk); > + if (tsk) { > + if (ht->pre_unpark) > + ht->pre_unpark(cpu); > + kthread_unpark(tsk); > + } This is a very watchdog centric implementation. The watchdog actually can afford to unregister/register the per cpu threads when the mask changes, but other facilities might not. So I'd like to see the threads still created and have the valid cpu check in the unpark function. That way you can just park/unpark a particular per cpu thread when the mask changes and you are not forced to teardown/reenable the whole facility. Thanks, tglx