Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310AbbG1Tt7 (ORCPT ); Tue, 28 Jul 2015 15:49:59 -0400 Received: from mail-am1on0094.outbound.protection.outlook.com ([157.56.112.94]:14522 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751261AbbG1Tt5 (ORCPT ); Tue, 28 Jul 2015 15:49:57 -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 , Catalin Marinas , Will Deacon , , , CC: Chris Metcalf Subject: [PATCH v5 0/6] support "cpu_isolated" mode for nohz_full Date: Tue, 28 Jul 2015 15:49:34 -0400 Message-ID: <1438112980-9981-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1436817481-8732-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD031;1:DKC99yuJqYaSKihCoJvdVz4NhZieOq+Ste2yLYS1lVU8qpsXrKB1qkCAiVmDcPmk28HucvJiWkORZdxKdloCUxMZfisYackWt9ORN9D/0y0iX1vmQGGpgHOVVGPC/7Pwzcg/dBLQOXSsEIeLi8jcAvySWbYlx2hfqgBFkaQuy5VQsaiWuXLNm5XQLEKUdOvAdtVR6Bp1Tjdzoq2Qm9YVDNJZUmn51SM4GbMDnOBd2nSl7oqYLn2bTVYJSsNnWKR9HlaOTKLb1WytYuftKDTFrnfvZH0rySEM2ktcp1hUu8Y= X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(339900001)(199003)(189002)(87936001)(2950100001)(36756003)(107886002)(6806004)(48376002)(50986999)(86362001)(2201001)(5001770100001)(92566002)(50226001)(50466002)(189998001)(62966003)(19580395003)(42186005)(15975445007)(106466001)(33646002)(5001960100002)(229853001)(85426001)(77156002)(46102003)(104016003)(47776003)(105606002)(921003)(1121003)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM2PR02MB0418;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0418;2:ozo++Vo2vvBjClWvLWOs/U3Um+xkoqfwry4X6GcnuNIcBVWlrgdXHGhopmma0VIFJqkDSQN2d99tuFK7XKOVeXGIMfFLCtAxByzIcyZ9oDWPf7geDONDOa7olR5GrXn90GagW0IE81sghXonLyVF+d32P4eyFinlzisvj9/rNEw=;3:zMyoJ2sjAlgHEoa4FqdnAMGMuuEkXNUuvEhNrab/P6JZbzx3DHytAhofoxXfB7ZPEgXGjJFcSHT99dTs/VwJ8j2VVCw2mYjQoasTm490h+EnlCzCXyVjSRNlOA1GZ53w3dTBnbHM0OYCTGkQOw45CKQVdqQ9a4qeyxonfh6iKe6YyxIQWWcxBbTRP4NsYdtaMo6PHGBJL1pm45V4oCFqWECUrTcOhSRm6zgJSKZaXxjcqBvpec5Z3eux9B+Hqgxx;25:ng8lL4hcMM4Zdm4WBNvNhDCRy3z19QX+GUFcM72I6K76G+gho/O5OihQrO4cR4QlcWZWgm9tzXpR8UkpzAt20Hnce5TbktRBX8dv/ERLetowAQ4bHyCvcNxhVnSFW6YMw/wcN24lKUClXN6bRmyb2kRaBXU+++LIhyL5YAz4rPdsAyxFLeDONg2sxqP5uEeb29vwOtAaTqbyVx6pxNiDViwzUeZ24KJIP+pWmYfLxAKbcCqS/E8+KbOgVjeAmz60w0Z1p1G5bW2u6GqZBTaCHg==;20:ENowMT81iFznSEBXllpY9OWT+4nbj+XJ5RWhg024uxECYPuTHcy9BpCFPWDmoTAecHf3FPFQ0HWssmVy/BDL6Prxr6dFZaZfC30F9OeTnxUeU9MA1BPkpky6UlCt2GoIdT50vg0ePoDtnmwwydul8kmQyPk8APpceYTG001nuSQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0418; AM2PR02MB0418: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:AM2PR02MB0418;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0418; X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0418;4:W2l3/gySwjjuor340mCc9oAPhLM2r/+Fdt+tSv2cafRdtqaAqb2n051shHz1PbJz50fKZ+C+M9ZVDjKXpVEwzhCp0Rgql/6ckeCemQpRhqvjyVGRh2kSP62skOOMqtkF0y5cSKSrqwSxK9nqcUf/6V+CIhmnBa7r31rCotyp6f9EiSILY42sV2qHVGQ4qqnyxCcMEnv4E0S2OBhArpz7j0uE8Fe7IRnoltBsZDhlS27y9NEQMgIT/pEJC8V9omp/epUS2fXUkse9Wasc+gGZIlfiEV05kQaeTOWHXR1iJac= X-Forefront-PRVS: 06515DA04B X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0418;23:aYNVC+FrDyy3byoCQPgP0F9K1R78gS3Yf2ByOwvK03/xnT6VrI7nsY4RcoeLIiN3NzZaFaJk8wxagOxz4cyCjC55iLjnv156sZtnMfg8tXA3Ka5mKqu6Z3GIiuxK78mnRjKYY6KHtgER3GCMqGhqFImglPNiSv9UIDSdBMGPQXnaNvl6q8gw/+KWFijSa5FDdGroBzD6aersCOx/BwFMxnXqd8Q2By7uqFMG2YJhKLcoXIEYlQhFX+wjHhTAYGr72CLRFsKnfaO+bmL+FRVUP14/qyTKIN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iagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2015 19:49:52.1734 (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: AM2PR02MB0418 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5853 Lines: 127 This version of the patch series incorporates Christoph Lameter's change to add a quiet_vmstat() call, and restructures cpu_isolated as a "hard" isolation mode in contrast to nohz_full's "soft" isolation, breaking it out as a separate CONFIG_CPU_ISOLATED with its own include/linux/cpu_isolated.h and kernel/time/cpu_isolated.c. It is rebased to 4.2-rc3. Thomas: as I mentioned in v4, I haven't heard from you whether my removal of the cpu_idle calls sufficiently addresses your concerns about that aspect. Andy: as I said in email, I've left in the support where cpu_isolated relies on the context_tracking stuff currently in 4.2-rc3. I'm not sure what the cleanest way is for me to pick up the new context_tracking stuff; if that's all that ends up standing between this patch series and having it be pulled, perhaps I can rebase it onto whatever branch it is that has the new context_tracking? Original patch series cover letter follows: 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. The kernel must be built with CONFIG_CPU_ISOLATED to take advantage of this new 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 v4.2-rc3) is available at: git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git dataplane v5: rebased on kernel v4.2-rc3 converted to use CONFIG_CPU_ISOLATED and separate .c and .h files incorporates Christoph Lameter's quiet_vmstat() call v4: rebased on kernel v4.2-rc1 added support for detecting CPU_ISOLATED_STRICT syscalls on arm64 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): cpu_isolated: add initial support cpu_isolated: support PR_CPU_ISOLATED_STRICT mode cpu_isolated: provide strict mode configurable signal cpu_isolated: add debug boot flag nohz: cpu_isolated: allow tick to be fully disabled Christoph Lameter (1): vmstat: provide a function to quiet down the diff processing Documentation/kernel-parameters.txt | 7 +++ arch/arm64/kernel/ptrace.c | 5 ++ arch/tile/kernel/process.c | 9 +++ arch/tile/kernel/ptrace.c | 5 +- arch/tile/mm/homecache.c | 5 +- arch/x86/kernel/ptrace.c | 2 + include/linux/context_tracking.h | 11 +++- include/linux/cpu_isolated.h | 42 +++++++++++++ include/linux/sched.h | 3 + include/linux/vmstat.h | 2 + include/uapi/linux/prctl.h | 8 +++ kernel/context_tracking.c | 12 +++- kernel/irq_work.c | 5 +- kernel/sched/core.c | 21 +++++++ kernel/signal.c | 5 ++ kernel/smp.c | 4 ++ kernel/softirq.c | 7 +++ kernel/sys.c | 8 +++ kernel/time/Kconfig | 20 +++++++ kernel/time/Makefile | 1 + kernel/time/cpu_isolated.c | 116 ++++++++++++++++++++++++++++++++++++ kernel/time/tick-sched.c | 3 +- mm/vmstat.c | 14 +++++ 23 files changed, 305 insertions(+), 10 deletions(-) create mode 100644 include/linux/cpu_isolated.h create mode 100644 kernel/time/cpu_isolated.c -- 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/