Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757374AbbFCPak (ORCPT ); Wed, 3 Jun 2015 11:30:40 -0400 Received: from mail-db3on0069.outbound.protection.outlook.com ([157.55.234.69]:49696 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756989AbbFCPaG (ORCPT ); Wed, 3 Jun 2015 11:30:06 -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 5/5] nohz: cpu_isolated: allow tick to be fully disabled Date: Wed, 3 Jun 2015 11:29:25 -0400 Message-ID: <1433345365-29506-6-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1433345365-29506-1-git-send-email-cmetcalf@ezchip.com> References: <1433345365-29506-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD039;1:JZXv7NsPZ9kiaM6oVEybKNyWLuhuuOM+z32tOHJAFNMvEfC7EdTYTNk1U6Fh+cE/J62MZznlhIR6LCcjsVC8p2s8tWSbY67bw20SwdPBC7itufCmtVnrS2nPV6UlijuOQ9WKpqCyL3PkOIZ0S7nvsT/OtlDcV6e+KAyjxWVijHAHnOGSvknOI547VehmLp0hMv+0AqTB0ts6JG3f07jKLvMvXBWqpgkpMIV5ulReYyq9WFvrZp111pQ7rDFxzdoo4L9m1d5LFVQM22KYCB9VeQWcw7AizbSr1nl+4MSC/iI= X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(199003)(50986999)(77156002)(50466002)(62966003)(86362001)(229853001)(33646002)(47776003)(64706001)(106356001)(87936001)(85426001)(48376002)(6806004)(81156007)(92566002)(106476002)(68736005)(50226001)(36756003)(104016003)(105606002)(19580405001)(4001540100001)(5001830100001)(42186005)(2950100001)(5001860100001)(76176999)(46102003)(97736004)(106466001)(5001770100001)(189998001)(107886002)(19580395003)(5001960100002)(15975445007)(9376004)(921003)(4001430100001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;PTR:InfoNoRecords;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0904; 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:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Forefront-PRVS: 05961EBAFC X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2015 15:29:59.5093 (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: DB5PR02MB0775 X-OriginatorOrg: ezchip.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2647 Lines: 56 While the current fallback to 1-second tick is still helpful for maintaining completely correct kernel semantics, processes using prctl(PR_SET_CPU_ISOLATED) semantics place a higher priority on running completely tickless, so don't bound the time_delta for such processes. In addition, due to the way such processes quiesce by waiting for the timer tick to stop prior to returning to userspace, without this commit it won't be possible to use the cpu_isolated mode at all. Removing the 1-second cap was previously discussed (see link below) and Thomas Gleixner observed that vruntime, load balancing data, load accounting, and other things might be impacted. Frederic Weisbecker similarly observed that allowing the tick to be indefinitely deferred just meant that no one would ever fix the underlying bugs. However it's at least true that the mode proposed in this patch can only be enabled on an isolcpus core by a process requesting cpu_isolated mode, which may limit how important it is to maintain scheduler data correctly, for example. Paul McKenney observed that if provide a mode where the 1Hz fallback timer is removed, this will provide an environment where new code that relies on that tick will get punished, and we won't forgive such assumptions silently, so it may also be worth it from that perspective. Finally, it's worth observing that the tile architecture has been using similar code for its Zero-Overhead Linux for many years (starting in 2008) and customers are very enthusiastic about the resulting bare-metal performance on cores that are available to run full Linux semantics on demand (crash, logging, shutdown, etc). So this semantics is very useful if we can convince ourselves that doing this is safe. Link: https://lkml.kernel.org/r/alpine.DEB.2.11.1410311058500.32582@gentwo.org Signed-off-by: Chris Metcalf --- kernel/time/tick-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index f09c003da22f..ec36ed00af9d 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -733,7 +733,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, } #ifdef CONFIG_NO_HZ_FULL - if (!ts->inidle) { + if (!ts->inidle && !tick_nohz_is_cpu_isolated()) { time_delta = min(time_delta, scheduler_tick_max_deferment()); } -- 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/