From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755284AbbDUMX1 (ORCPT ); Tue, 21 Apr 2015 08:23:27 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:35064 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755209AbbDUMXX (ORCPT ); Tue, 21 Apr 2015 08:23:23 -0400 From: Frederic Weisbecker To: LKML Cc: Chris Metcalf , Peter Zijlstra , Mike Galbraith , Ingo Molnar , Dave Jones , Thomas Gleixner , Oleg Nesterov , "Rafael J . Wysocki" , "Paul E . McKenney" , Ingo Molnar , Frederic Weisbecker , Rik van Riel , Martin Schwidefsky Subject: [PATCH 3/4] nohz: Add tick_nohz_full_add_cpus_to() API Date: Tue, 21 Apr 2015 14:23:08 +0200 Message-Id: <1429618989-11104-4-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1429618989-11104-1-git-send-email-fweisbec@gmail.com> References: <1429618989-11104-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Metcalf This API is useful to modify a cpumask indicating some special nohz-type functionality so that the nohz cores are automatically added to that set. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Chris Metcalf Cc: Peter Zijlstra (Intel) Cc: Paul E. McKenney Cc: Rafael J. Wysocki Cc: Martin Schwidefsky Cc: Ingo Molnar Link: http://lkml.kernel.org/r/1429024675-18938-1-git-send-email-cmetcalf@ezchip.com Signed-off-by: Frederic Weisbecker --- include/linux/tick.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/tick.h b/include/linux/tick.h index f8492da5..4191b56 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -134,6 +134,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_add_cpus_to(struct cpumask *mask) +{ + if (tick_nohz_full_enabled()) + cpumask_or(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); @@ -142,6 +148,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_add_cpus_to(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.4