Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753982AbcCBUKC (ORCPT ); Wed, 2 Mar 2016 15:10:02 -0500 Received: from mail-am1on0098.outbound.protection.outlook.com ([157.56.112.98]:35940 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752875AbcCBUJ7 (ORCPT ); Wed, 2 Mar 2016 15:09:59 -0500 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;ezchip.com; dmarc=none action=none header.from=ezchip.com; 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 , Daniel Lezcano , , , CC: Chris Metcalf Subject: [PATCH v10 00/12] support "task_isolation" mode Date: Wed, 2 Mar 2016 15:09:24 -0500 Message-ID: <1456949376-4910-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:12.216.194.146;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(339900001)(189002)(199003)(50466002)(5003940100001)(47776003)(189998001)(92566002)(5001970100001)(33646002)(5008740100001)(5001770100001)(4001430100002)(19580395003)(50986999)(11100500001)(81156011)(48376002)(19580405001)(104016004)(50226001)(36756003)(229853001)(87936001)(4326007)(586003)(105606002)(106466001)(2201001)(85426001)(1220700001)(2906002)(6806005)(107886002)(15975445007)(42186005)(1096002)(21314002)(921003)(42882005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1692;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-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uF9+YH8B1gLwnzbIrE+IxA/3VBC4zTlTrIx9BAfbvuICDyWC6dwH9W0Vc2JFPS3qGWkTSOXbZp2nyG//1ABhajsp9hL+YO8ehFdhl3Ed7qj/d3GF74Fo1+7jnZIY6APAcKAxuLMd9i0Ae2KaCnCI4rC0A9WI5Lzy/FhHsV3zGk1l18AlB+OJP//aVJaPDxiIlSZU81YlhZeAg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1692; X-MS-Office365-Filtering-Correlation-Id: b10aabe0-fcbf-4163-513d-08d342d69e9b X-MLNXRule-EZCH-Linux: Rule triggered X-MLNXRule-Acc-Dom-4: Rule triggered X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1692;20:bMjda2ueCndxdki7EhgU+4e0wkJUE9ATVnHppZG8t7yrbZbcrJT3yDcarLWR76CrUYkvlFf22RlTml7PmA2FPgL++uHGRz672Eb+NwAIr2iH7IoIFzClK/AvmwNTh5m3d6F9QYIR7B3pqFy5R3Cg6s2800Zk8Gk2PDh09YJIz1mH9lRS9EJp7+G/B1XvjXUvUef5P+Up3upQzUPSeEqUwVfkabqjW45xjabai76oBzROl+10vLpVNaYZOUGvQSMQkcjsDSrmKsN2BUWF9++FxpVanj4EStbM6YelDKyG0i2nsuULNKzOasFikjYvwcEQ9dqjZitjgnKF45nQttf7vcUq6S4L8f+W4DzkJO1/8nJKIZ4lD38PjXuQKD7IPoG5sbAgpHYxCQbpHu2x3oeHv67D2rL/1j07UhTzwBqOmYDMbdyAo9ppbhcCKoE6IKpHU+IV3s/BPvsDKgaG3erZonPzo+Xsn+s5KVKw96wQLqcm5GjaGviIPxlKq4sK/XIJEiOZ9kXSdEsZZeC15RB2hDEGJmwbSJfPII47tjVug3cwL8iA4Fbfl7zhu9Vj9KzKNGR6irW2v289xZOhS9JQWy6DcJPYHNzeHo4dOJeNec0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(13015025)(13023025)(8121501046)(13017025)(13024025)(5005006)(10201501046)(3002001);SRVR:HE1PR05MB1692;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1692; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1692;4:5XnoBwTLcVMdyQTutUYtkGd0/ofeSQ4C4wcGutGxFCWIcQj+87y8DMJ4CyUfaKHUTeg7R/VEKiraZ58G8iH42UhfH7ZhsHte24Xw5aBvg91aGuD5mK17NfpcWurLbhCsfBz96Vqna0ogdMgqVVi/AplJnHwrF1hRCqcattWLsmnXf23GviDBz+OQPz/5liqYf0ZXroQYwyYJ75h7969ZTZjbzhB6FvXiBDN4dBt4AnQ+ikkhRLc/w2Efw59KSZRorXreYE2CT01+nFFq+jwf7CpahsDKE2Po+/N8SGtP7UfNAOeNYkMyngtt+D17f6MwjyWrq+K130AQwLQPnvHC9Vx/iUYNsomAcP+NZapVzu/3/JVNhh7YPtGG1Q1KabVLB0f0HUKTEIUmoQGBxPKnPAwhT4yzfyj/h8cGNJk0+Eh3nFnUCiBI1aDAkTm5PLXnNFOFmk6EfzQetXEqfMJzDg== X-Forefront-PRVS: 086943A159 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR05MB1692;23:IpknAc+qXJzdWxvM4md2yqZSIEb5Hsf2qMzqAA477?= =?us-ascii?Q?IQKxI7FhWC2nHN7JH4505mzw2vZAfFvLrIC1YtECulZKxqjqDuDxWmRv1CJW?= =?us-ascii?Q?BoaoZk0bw1dwguiTsv0aGhp40wf43pl2S58vuqpY3lwnlyN+VHQ2De8WieiW?= =?us-ascii?Q?VIEeyYkEP2mkclTNCXBNC5cdPTBK+wPpQB12XB5fkCG7FPDwYEPDhdILpgYv?= =?us-ascii?Q?sfg5jh9PTDegt4Ugi/CXwbcO6O1GvDuOK2sItSJ0/pSsPkM52WH2R9f1Obsu?= =?us-ascii?Q?xovPdAIOIA0TR/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?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1692;5:uhoPD0bBtbqU/CfqUC3sBpn0Ze92gWrkhXjg2Gp+lR2YcCr9h73WbTE6q+k6x3gUN29uIQQ1FR2uPIWx0kmjFs/R4j85MrL3Mpj85b7l1V/oHjEbxP0vHph09RXwzP/0yWHdCuPDCW3t2/V3avyFRg==;24:RuEkrWdLbYuzlMNS6GOBCSxxUKX/a+xZXycQyF+2Tip9t05vj4A6pnY3Bz9KNWezrzc93bmzyJl6QGkO3yuan3blA3irpPRs4EmjiEgSvMY= X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2016 20:09:53.6573 (UTC) X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a652971c-7d2e-4d9b-a6a4-d149256f461b;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1692 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5692 Lines: 129 Here is the latest version of the task-isolation patch set, adopting various suggestions made about the v9 patch series, including some feedback from testing on the new EZchip NPS ARC platform (although the new arch/arc support is not included in this patch series). All of the suggestions were relatively non-controversial. Perhaps we are getting close to being able to merge this. :-) Changes since v9: - task_isolation is now set up by adding its required cpus to both the nohz_full and isolcpus cpumasks. This allows users to separately specify all three flags, if so desired, and still get reasonably sane semantics. This is done with a new tick_nohz_full_add_cpus() method for nohz, and just directly updating the isolcpus cpumask. - We add a /sys/devices/system/cpu/task_isolation file to parallel the equivalent nohz_full file. (This should have been in v8 since once task_isolation isn't equivalent to nohz_full, it needs its own way to let userspace know where to run.) - We add a new Kconfig option, TASK_ISOLATION_ALL, which sets all but the boot processor to run in task isolation mode. This parallels the existing NO_HZ_FULL_ALL and works around the fact that you can't easily specify a boot argument with the desired semantics. - For task_isolation_debug, we add a check of the context_tracking state of the remote cpu before issuing a warning; if the remote cpu is actually in the kernel, we don't need to warn. - A cloned child of a task_isolation task is not enabled for task_isolation, since otherwise they would both fight over who could safely return to userspace without requiring scheduling interrupts. - The quiet_vmstat() function's semantics was changed since the v9 patch series, so I introduce a quiet_vmstat_sync() for isolation. - The lru_add_drain_needed() function is updated to know about the new lru_deactivate_pvecs variable. - The arm64 patch factoring assembly into C has been modified based on an earlier patch by Mark Rutland. - I simplified the enabling patch for arm64 by realizing we could just test TIF_NOHZ as the only bit for TIF_WORK_MASK for task isolation, so I didn't have to renumber all the TIF_xxx bits. - Small fixes to avoid preemption warnings. - Rebased on v4.5-rc5 For changes in earlier versions of the patch series, please see: http://lkml.kernel.org/r/1451936091-29247-1-git-send-email-cmetcalf@ezchip.com A couple of the tile patches that refactored the context tracking code were taken into 4.5 so are no longer present in this series. This version of the patch series has been tested on arm64 and tile, and build-tested on x86. It remains true that the 1 Hz tick needs to be disabled for this patch series to be able to achieve its primary goal of enabling truly tick-free operation, but that is ongoing orthogonal work. The series is available at: git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git dataplane Chris Metcalf (12): vmstat: add quiet_vmstat_sync function vmstat: add vmstat_idle function lru_add_drain_all: factor out lru_add_drain_needed task_isolation: add initial support task_isolation: support CONFIG_TASK_ISOLATION_ALL task_isolation: support PR_TASK_ISOLATION_STRICT mode task_isolation: add debug boot flag arm, tile: turn off timer tick for oneshot_stopped state arch/x86: enable task isolation functionality arch/tile: enable task isolation functionality arm64: factor work_pending state machine to C arch/arm64: enable task isolation functionality Documentation/kernel-parameters.txt | 16 ++ arch/arm64/include/asm/thread_info.h | 8 +- arch/arm64/kernel/entry.S | 12 +- arch/arm64/kernel/ptrace.c | 12 +- arch/arm64/kernel/signal.c | 34 ++++- arch/arm64/kernel/smp.c | 2 + arch/arm64/mm/fault.c | 4 + arch/tile/kernel/process.c | 6 +- arch/tile/kernel/ptrace.c | 6 + arch/tile/kernel/single_step.c | 5 + arch/tile/kernel/smp.c | 28 ++-- arch/tile/kernel/time.c | 1 + arch/tile/kernel/unaligned.c | 3 + arch/tile/mm/fault.c | 3 + arch/tile/mm/homecache.c | 2 + arch/x86/entry/common.c | 18 ++- arch/x86/kernel/traps.c | 2 + arch/x86/mm/fault.c | 2 + drivers/base/cpu.c | 18 +++ drivers/clocksource/arm_arch_timer.c | 2 + include/linux/context_tracking_state.h | 6 + include/linux/isolation.h | 83 +++++++++++ include/linux/sched.h | 3 + include/linux/swap.h | 1 + include/linux/tick.h | 1 + include/linux/vmstat.h | 4 + include/uapi/linux/prctl.h | 8 + init/Kconfig | 30 ++++ kernel/Makefile | 1 + kernel/fork.c | 3 + kernel/irq_work.c | 5 +- kernel/isolation.c | 261 +++++++++++++++++++++++++++++++++ kernel/sched/core.c | 18 +++ kernel/signal.c | 5 + kernel/smp.c | 6 +- kernel/softirq.c | 33 +++++ kernel/sys.c | 9 ++ kernel/time/tick-sched.c | 31 ++-- mm/swap.c | 15 +- mm/vmstat.c | 24 +++ 40 files changed, 676 insertions(+), 55 deletions(-) create mode 100644 include/linux/isolation.h create mode 100644 kernel/isolation.c -- 2.1.2