From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932614AbcHIUbH (ORCPT ); Tue, 9 Aug 2016 16:31:07 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:57457 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932509AbcHIUaU (ORCPT ); Tue, 9 Aug 2016 16:30:20 -0400 From: Chris Metcalf To: Gilad Ben Yossef , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Will Deacon , Andy Lutomirski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chris Metcalf Subject: [PATCH v14 12/14] task_isolation: support CONFIG_TASK_ISOLATION_ALL Date: Tue, 9 Aug 2016 16:29:54 -0400 Message-Id: <1470774596-17341-13-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1470774596-17341-1-git-send-email-cmetcalf@mellanox.com> References: <1470774596-17341-1-git-send-email-cmetcalf@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This option, similar to NO_HZ_FULL_ALL, simplifies configuring a system to boot by default with all cores except the boot core running in task isolation mode. Signed-off-by: Chris Metcalf --- init/Kconfig | 10 ++++++++++ kernel/isolation.c | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 85a4b6dd26f2..2d49c5b78b93 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -813,6 +813,16 @@ config TASK_ISOLATION You should say "N" unless you are intending to run a high-performance userspace driver or similar task. +config TASK_ISOLATION_ALL + bool "Provide task isolation on all CPUs by default (except CPU 0)" + depends on TASK_ISOLATION + help + If the user doesn't pass the task_isolation boot option to + define the range of task isolation CPUs, consider that all + CPUs in the system are task isolation by default. + Note the boot CPU will still be kept outside the range to + handle timekeeping duty, etc. + config BUILD_BIN2C bool default n diff --git a/kernel/isolation.c b/kernel/isolation.c index 7cd57ca95be5..f8ccf5e67e38 100644 --- a/kernel/isolation.c +++ b/kernel/isolation.c @@ -43,8 +43,14 @@ int __init task_isolation_init(void) { /* For offstack cpumask, ensure we allocate an empty cpumask early. */ if (!saw_boot_arg) { +#ifdef CONFIG_TASK_ISOLATION_ALL + alloc_cpumask_var(&task_isolation_map, GFP_KERNEL); + cpumask_copy(task_isolation_map, cpu_possible_mask); + cpumask_clear_cpu(smp_processor_id(), task_isolation_map); +#else zalloc_cpumask_var(&task_isolation_map, GFP_KERNEL); return 0; +#endif } /* -- 2.7.2