From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753123AbbC3QUc (ORCPT ); Mon, 30 Mar 2015 12:20:32 -0400 Received: from mail-am1on0097.outbound.protection.outlook.com ([157.56.112.97]:5536 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752853AbbC3QUa (ORCPT ); Mon, 30 Mar 2015 12:20:30 -0400 Message-ID: <551977C1.4000303@ezchip.com> Date: Mon, 30 Mar 2015 12:20:17 -0400 From: Chris Metcalf User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: , Frederic Weisbecker , Steven Rostedt , "Paul E. McKenney" , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Borislav Petkov , Li Zhong , Mike Galbraith , Kevin Hilman , Rik van Riel Subject: Re: [PATCH 3/4] nohz: add tick_nohz_full_clear_cpus() API References: <1427224895-30830-1-git-send-email-cmetcalf@ezchip.com> <1427224895-30830-4-git-send-email-cmetcalf@ezchip.com> In-Reply-To: <1427224895-30830-4-git-send-email-cmetcalf@ezchip.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BLUPR11CA0062.namprd11.prod.outlook.com (10.141.30.30) To DB3PR02MB0539.eurprd02.prod.outlook.com (25.160.51.150) Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR02MB0539; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10009020)(6009001)(6049001)(479174004)(51704005)(46034005)(24454002)(377454003)(65816999)(122386002)(59896002)(15975445007)(76176999)(40100003)(64126003)(54356999)(65956001)(80316001)(66066001)(19580395003)(99136001)(86362001)(83506001)(33656002)(50986999)(77096005)(46102003)(62966003)(107886001)(92566002)(36756003)(87266999)(50466002)(23746002)(19580405001)(87976001)(42186005)(2950100001)(77156002)(7059030)(921003)(1121003)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR02MB0539;H:[10.7.0.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DB3PR02MB0539;BCL:0;PCL:0;RULEID:;SRVR:DB3PR02MB0539; X-Forefront-PRVS: 05315CBE52 X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2015 16:20:27.2171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR02MB0539 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I wanted to ping the patch below again, since I haven't heard any feedback. I note that Rik van Riel's change posted this weekend offers similar functionality for userspace. My change offers a convenient API for, e.g., kernel drivers setting up default irq balancing. https://lkml.org/lkml/2015/3/28/94 Although it would be possible to do the same thing by iterating over the existing tick_nohz_full_cpu() API, that seems kind of silly. An alternate API would be one that just returned the full no_hz cpumask to kernel callers; I'd be happy with that as well, but my instinct was to make the API as narrow as possible to start with. Comments? On 03/24/2015 03:21 PM, cmetcalf@ezchip.com wrote: > From: Chris Metcalf > > This is useful, for example, to modify a cpumask to avoid the > nohz cores so that interrupts aren't sent to them. > > Signed-off-by: Chris Metcalf > --- > Motivated by patch 4/4 in this series. > > include/linux/tick.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/linux/tick.h b/include/linux/tick.h > index 9c085dc12ae9..d53ad4892a39 100644 > --- a/include/linux/tick.h > +++ b/include/linux/tick.h > @@ -186,6 +186,12 @@ static inline bool tick_nohz_full_cpu(int cpu) > return cpumask_test_cpu(cpu, tick_nohz_full_mask); > } > > +static inline void tick_nohz_full_clear_cpus(struct cpumask *mask) > +{ > + if (tick_nohz_full_enabled()) > + cpumask_andnot(mask, mask, tick_nohz_full_mask); > +} > + > extern void __tick_nohz_full_check(void); > extern void tick_nohz_full_kick(void); > extern void tick_nohz_full_kick_cpu(int cpu); > @@ -194,6 +200,7 @@ extern void __tick_nohz_task_switch(struct task_struct *tsk); > #else > static inline bool tick_nohz_full_enabled(void) { return false; } > static inline bool tick_nohz_full_cpu(int cpu) { return false; } > +static inline void tick_nohz_full_clear_cpus(struct cpumask *mask) { } > static inline void __tick_nohz_full_check(void) { } > static inline void tick_nohz_full_kick_cpu(int cpu) { } > static inline void tick_nohz_full_kick(void) { } -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com