Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757055AbbFCP3z (ORCPT ); Wed, 3 Jun 2015 11:29:55 -0400 Received: from mail-am1on0093.outbound.protection.outlook.com ([157.56.112.93]:26078 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754019AbbFCP3o (ORCPT ); Wed, 3 Jun 2015 11:29:44 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; 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 , , , CC: Chris Metcalf Subject: [PATCH v3 0/5] support "cpu_isolated" mode for nohz_full Date: Wed, 3 Jun 2015 11:29:20 -0400 Message-ID: <1433345365-29506-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1431725178-20876-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD049;1:5FLx2J8Lf0gcemoourg3sUlVcEAfCO32N61zOLXla1uQad6YF8FdwOo3JJ6dsdzvxcUUrLLEf7MK0/YcbmFRQOwj0UZ8Jq9W0N0puto7cccg4VOetfL7Exy1Y53C7qKHteHpiIzbCjJsMo34jXkXIeo76+1TOkMNE+KSVIr44ZdFtIOul9/xg2Rtk5wr+Q96KnQ/s7D0UJ+OjERn7PX6X05LHYyvinH9GzAS5n8ZW2yscXk5KLCUIjlsSsBWxgvsLz0aCprrCPzQNd8EV00mBumWGvEnv0ohjXOBZFBCPOo= X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(199003)(189002)(4001540100001)(5001770100001)(50226001)(105606002)(33646002)(50986999)(92566002)(68736005)(85426001)(15975445007)(5001960100002)(106466001)(77156002)(189998001)(2950100001)(81156007)(86362001)(97736004)(42186005)(62966003)(5001830100001)(106476002)(106356001)(5001860100001)(50466002)(46102003)(87936001)(104016003)(19580395003)(2201001)(6806004)(229853001)(47776003)(48376002)(107886002)(64706001)(36756003)(9376004)(921003)(4001430100001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR02MB0783;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;PTR:InfoNoRecords;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0783; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:VI1PR02MB0783;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0783; X-Forefront-PRVS: 05961EBAFC X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2015 15:29:39.0361 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB0783 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4153 Lines: 86 The existing nohz_full mode does a nice job of suppressing extraneous kernel interrupts for cores that desire it. However, there is a need for a more deterministic mode that rigorously disallows kernel interrupts, even at a higher cost in user/kernel transition time: for example, high-speed networking applications running userspace drivers that will drop packets if they are ever interrupted. These changes attempt to provide an initial draft of such a framework; the changes do not add any overhead to the usual non-nohz_full mode, and only very small overhead to the typical nohz_full mode. A prctl() option (PR_SET_CPU_ISOLATED) is added to control whether processes have requested this stricter semantics, and within that prctl() option we provide a number of different bits for more precise control. Additionally, we add a new command-line boot argument to facilitate debugging where unexpected interrupts are being delivered from. Code that is conceptually similar has been in use in Tilera's Multicore Development Environment since 2008, known as Zero-Overhead Linux, and has seen wide adoption by a range of customers. This patch series represents the first serious attempt to upstream that functionality. Although the current state of the kernel isn't quite ready to run with absolutely no kernel interrupts (for example, workqueues on cpu_isolated cores still remain to be dealt with), this patch series provides a way to make dynamic tradeoffs between avoiding kernel interrupts on the one hand, and making voluntary calls in and out of the kernel more expensive, for tasks that want it. The series (based currently on my arch/tile master tree for 4.2, in turn based on 4.1-rc1) is available at: git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git dataplane v3: remove dependency on cpu_idle subsystem (Thomas Gleixner) use READ_ONCE instead of ACCESS_ONCE in tick_nohz_cpu_isolated_enter use seconds for console messages instead of jiffies (Thomas Gleixner) updated commit description for patch 5/5 v2: rename "dataplane" to "cpu_isolated" drop ksoftirqd suppression changes (believed no longer needed) merge previous "QUIESCE" functionality into baseline functionality explicitly track syscalls and exceptions for "STRICT" functionality allow configuring a signal to be delivered for STRICT mode failures move debug tracking to irq_enter(), not irq_exit() Note: I have not removed the commit to disable the 1Hz timer tick fallback that was nack'ed by PeterZ, pending a decision on that thread as to what to do (https://lkml.org/lkml/2015/5/8/555); also since if we remove the 1Hz tick, cpu_isolated threads will never re-enter userspace since a tick will always be pending. Chris Metcalf (5): nohz_full: add support for "cpu_isolated" mode nohz: support PR_CPU_ISOLATED_STRICT mode nohz: cpu_isolated strict mode configurable signal nohz: add cpu_isolated_debug boot flag nohz: cpu_isolated: allow tick to be fully disabled Documentation/kernel-parameters.txt | 6 +++ arch/tile/kernel/process.c | 9 ++++ arch/tile/kernel/ptrace.c | 6 ++- arch/tile/mm/homecache.c | 5 +- arch/x86/kernel/ptrace.c | 2 + include/linux/context_tracking.h | 11 ++-- include/linux/sched.h | 3 ++ include/linux/tick.h | 28 ++++++++++ include/uapi/linux/prctl.h | 8 +++ kernel/context_tracking.c | 12 +++-- kernel/irq_work.c | 4 +- kernel/sched/core.c | 18 +++++++ kernel/signal.c | 5 ++ kernel/smp.c | 4 ++ kernel/softirq.c | 6 +++ kernel/sys.c | 8 +++ kernel/time/tick-sched.c | 104 +++++++++++++++++++++++++++++++++++- 17 files changed, 229 insertions(+), 10 deletions(-) -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/