From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753588AbbDJBex (ORCPT ); Thu, 9 Apr 2015 21:34:53 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35445 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbbDJBeu (ORCPT ); Thu, 9 Apr 2015 21:34:50 -0400 Date: Fri, 10 Apr 2015 03:34:45 +0200 From: Frederic Weisbecker To: Chris Metcalf Cc: "Peter Zijlstra (Intel)" , "Paul E. McKenney" , "Rafael J. Wysocki" , Martin Schwidefsky , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 1/2] nohz: add tick_nohz_full_add_cpus_to() and _remove_cpus_from() APIs Message-ID: <20150410013443.GE18314@lerouge> References: <20150409174218.GT21418@twins.programming.kicks-ass.net> <1428602506-16753-1-git-send-email-cmetcalf@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428602506-16753-1-git-send-email-cmetcalf@ezchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 09, 2015 at 02:01:45PM -0400, Chris Metcalf wrote: > The "removes_cpus_from" API is useful, for example, to modify a cpumask > to avoid the nohz cores so that interrupts aren't sent to them. > > Likewise the "add_cpus_to" API is useful to modify a cpumask indicating > some special nohz-type functionality so that the nohz cores are > automatically added to that set. > > Signed-off-by: Chris Metcalf > --- > v6: I think we may finally have accessor names that are OK > > v5: (skipped this patch) > > v4: update accessor names to make them clearer [PeterZ] > > v3: no change here, just in part 2/2. > > v2: put the "...set_cpus" API together with the change to > init_sched_domains() so that they can go into the timer tree > independently of other changes in my tree. > > include/linux/tick.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/include/linux/tick.h b/include/linux/tick.h > index 9c085dc12ae9..8d1754c0f694 100644 > --- a/include/linux/tick.h > +++ b/include/linux/tick.h > @@ -186,6 +186,18 @@ static inline bool tick_nohz_full_cpu(int cpu) > return cpumask_test_cpu(cpu, tick_nohz_full_mask); > } > > +static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) Or tick_nohz_full_affine() ? > +{ > + if (tick_nohz_full_enabled()) > + cpumask_or(mask, mask, tick_nohz_full_mask); > +} > + > +static inline void tick_nohz_full_remove_cpus_from(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 +206,8 @@ 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_add_cpus_to(struct cpumask *mask) { } > +static inline void tick_nohz_full_remove_cpus_from(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) { } > -- > 2.1.2 >