From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754318AbbDHOHE (ORCPT ); Wed, 8 Apr 2015 10:07:04 -0400 Received: from mail-am1on0074.outbound.protection.outlook.com ([157.56.112.74]:59808 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753834AbbDHOG6 (ORCPT ); Wed, 8 Apr 2015 10:06:58 -0400 Message-ID: <552535F4.5020504@ezchip.com> Date: Wed, 8 Apr 2015 10:06:44 -0400 From: Chris Metcalf User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Frederic Weisbecker CC: 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 , , Jonathan Corbet , , Thomas Gleixner , "Peter Zijlstra" Subject: Re: [PATCH v5 1/2] smpboot: allow excluding cpus from the smpboot threads References: <1258649504.12464273.1428252407339.JavaMail.zimbra@redhat.com> <1428349556-21873-1-git-send-email-cmetcalf@ezchip.com> <1428349556-21873-2-git-send-email-cmetcalf@ezchip.com> <20150408132856.GA13227@lerouge> In-Reply-To: <20150408132856.GA13227@lerouge> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BN3PR09CA0033.namprd09.prod.outlook.com (25.160.111.171) To DB5PR02MB0776.eurprd02.prod.outlook.com (25.161.243.147) Authentication-Results: infradead.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0776;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0662; X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(6049001)(479174004)(377454003)(51704005)(24454002)(19580395003)(1411001)(15975445007)(77156002)(50466002)(62966003)(66066001)(19580405001)(46102003)(92566002)(77096005)(36756003)(65816999)(122386002)(40100003)(33656002)(64126003)(59896002)(87266999)(76176999)(54356999)(47776003)(23746002)(110136001)(2950100001)(42186005)(65956001)(86362001)(50986999)(87976001)(93886004)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0776;H:[10.7.0.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:DB5PR02MB0776;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0776; X-Forefront-PRVS: 0540846A1D X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2015 14:06:52.8553 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0776 X-OriginatorOrg: ezchip.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/08/2015 09:28 AM, Frederic Weisbecker wrote: > On Mon, Apr 06, 2015 at 03:45:55PM -0400, cmetcalf@ezchip.com wrote: >> From: Chris Metcalf >> >> This change allows some cores to be excluded from running the >> smp_hotplug_thread tasks. The motivating example for this is >> the watchdog threads, which by default we don't want to run >> on any enabled nohz_full cores. >> >> Signed-off-by: Chris Metcalf >> --- >> include/linux/smpboot.h | 2 ++ >> kernel/smpboot.c | 11 ++++++++--- >> 2 files changed, 10 insertions(+), 3 deletions(-) >> >> diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h >> index d600afb21926..de2f64a98108 100644 >> --- a/include/linux/smpboot.h >> +++ b/include/linux/smpboot.h >> @@ -27,6 +27,7 @@ struct smpboot_thread_data; >> * @pre_unpark: Optional unpark function, called before the thread is >> * unparked (cpu online). This is not guaranteed to be >> * called on the target cpu of the thread. Careful! >> + * @exclude_mask: Optional cpumask, specifying cores to exclude. >> * @selfparking: Thread is not parked by the park function. >> * @thread_comm: The base name of the thread >> */ >> @@ -41,6 +42,7 @@ struct smp_hotplug_thread { >> void (*park)(unsigned int cpu); >> void (*unpark)(unsigned int cpu); >> void (*pre_unpark)(unsigned int cpu); >> + cpumask_t *exclude_mask; > The usual pattern for cpumasks is to use them as affinity values instead > of non-affinity values. Yes. The issue here is that as cpus come and go from the hotplug set, the ones that we want to exclude remain fixed. If we do it the way you propose (and it's the way I originally did it), it means that if a new cpu comes online you automatically treat it as nohz_full, which seems wrong to me. I suppose we could add another callback so that the smp_hotplug_thread struct could explicitly decide how to mark any new cpu that comes online, but that all seems more complicated than my final suggestion. What do you think? -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com