Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbbGMT6n (ORCPT ); Mon, 13 Jul 2015 15:58:43 -0400 Received: from mail-db3on0091.outbound.protection.outlook.com ([157.55.234.91]:9856 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752667AbbGMT6e (ORCPT ); Mon, 13 Jul 2015 15:58:34 -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 v4 5/5] nohz: cpu_isolated: allow tick to be fully disabled Date: Mon, 13 Jul 2015 15:58:01 -0400 Message-ID: <1436817481-8732-6-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> References: <1436817481-8732-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11OLC002;1:f/fZL2uAA8bAT486KaWXLGEl/+D4PQhSz1RzlKLLr4DbWtSkqWOkeZbKX/nGvVF6lRK0JSMzrWAJoDnh4c2VWZ6s3FCvZwFWQMli1+93U65vmwgG97yZ2pE6tyYvIYXhBFVDAE3IwWc0nnA9LtnrBFMFGTd1Vj3tTTP+iH7+aWCn1ahGM5LkEwd1C5FoLdDUEkf4C8XvXX0NSwqu9OMtz4Z2I0b9HthmL71zrZPi5F0w4cXWEz3K1T+uMzfHTJXtC2RtGDlEan1zc7GV4Mg8Xje1rZVtqj7WXTdSsrwuYa5a96DxTEPTFVbccjC/p5slev2ENDcJRMxR3Depu+GhMeVKiMdcO6bsTp3k2uDljPb/MglUecPhGxEE7HlaedpBqYHxjt4igN75A2oByqsF5g== X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(6009001)(2980300002)(339900001)(199003)(189002)(48376002)(85426001)(106466001)(107886002)(33646002)(189998001)(5001770100001)(77156002)(104016003)(5001960100002)(229853001)(50466002)(76176999)(105606002)(15975445007)(46102003)(2950100001)(106356001)(36756003)(50986999)(92566002)(50226001)(6806004)(19580395003)(87936001)(19580405001)(47776003)(62966003)(5003940100001)(86362001)(42186005)(9376004)(921003)(1121003)(4001430100001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR02MB0421;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:ovrnspm;A:1;MX:1;PTR:InfoNoRecords;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB0421;2:StHd9KLmTs7HYJo5hPjkFvVTttYgVFRk8+rzfh/s/gzPPseEzsONQ3KvKvql01ZA;3:oI0VfQHWoHfdgGCRHNq3xHTB6KWjCSSI/JeGUyc2UlvFDpqXv0rSc2RsPbDafgUQ2ZkjlyQwDHxHNFYjfpZOGP2n7e3YNvM8dIarwlVzRgiQf0wSBHR0YSQfg2Ve1KN25a6lCRCr70H3Yz7VV1FoVD9f90LvHq0kbgdK66HWW13mjW3UH8ib3Czo3Xi2QRiwsEzqL/HWHv8QSQNkIcz7Px+Mu5rOVdcGG0ZjjWAykjCnnG7bfAPNSHl5bi6liIhJ;25:U9+C0uJEnvc82/ZMhVBovwWKmKiw5AhhZ1VqSRZh/hvGZhaBeqd5vZhmZzFdRMEX5Y0TA9gzdCLW4mJcHrrsNaQbKvzfsNeTRQ3RJ/a7dacxgmJPw7DTLsNKd45kfCnm+r8K7f+6gtqqeBFcgFOV6mTcP09TE/17GJR59k2dBjHUka3gkY60OjpEq6PyTAzXNyOuT1sZiDuWHd3mYJQlGgga1Id8o7pBbc7JZKG8jhkZuKwu8Mp36xD2z+4KI1XYNcux8CPJWTWB0m4YoiDSWQ==;20:v/z0bXfxED9wKoqAA4+/m2uaNOhGEDIra4eKFS2AcwHWIkQ2ECPtLYlg9/T4o/R06lj0RJO3fEtkGMAlWRekXOvnjZ+PdKLw+x2eFK97kvuyfJUNWBFs4nwoFXqgybTxxgFS91jerId2PEATn4gHIdEVxcYor66KhuwFk6CP7zE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB0421; AM3PR02MB0421: 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:AM3PR02MB0421;BCL:0;PCL:0;RULEID:;SRVR:AM3PR02MB0421; X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB0421;4:NEbJcUqBAXiYQOV65gHKU0iX7yEZ0r5acI/UoDkHDnPWy2wLmHs7vg9EWIF8tDsExoT5Xxs4JlKBdLsgf0ffdn8sLIN8Hu2QCIBv5MfuqmOrL3p8wG/JlVhNiaI5D5lUjiShroynhnvHcefycqfjrKxF+TcOXRkH1rfpNE3nm6SRp3EqvB++KCkGFL6DOgBFm35txHY3oesSHINrQeNSlvL+8Cco5dTjMEpj1EMA7YcCCHJ2v6Y/7ixuN9tZ7nZydfyQvi5Vla1SCuf0Z1YzZT0tsft3dVvuo5o5WXTSbXM= X-Forefront-PRVS: 0636271852 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM3PR02MB0421;23:fb4w31RbudKgJaLkNdRqV1mKll12+SJ1p7+GnqZ50?= =?us-ascii?Q?UFrv5KIVxVOO6K73Bf/QSe56ElOE1uuiGE7nfPfvWLmt0g81TnkShOBbhQ9g?= =?us-ascii?Q?A+us6jgnlJgwVAQqrRqRh1SXluE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-ascii?Q?iRZ1BbgJtPdSMmUTNz+k7s6AyObWlhEDva/0JkjblATeLrPS0BO0acsMmopL?= =?us-ascii?Q?33lZukwMzLsKp9vvRpHo9YJJINSx6Lo5Suyl5BQbc9EmGHSd4kaZ+NgsRWmm?= =?us-ascii?Q?V1XXn0A+knXq73Ksm1+v30Tsl7p7SLpeLA7Q4hgV4u2cmWi4luFPg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM3PR02MB0421;5:WR/DnRM8HjhlA7duI3VIyttNHn6jDeqWUrXJQKqsqfkcP8IEBq6aYCWWASzYvsGQDL6b8yitZEp0FKgyYN1XBbsPILVgviLkjNCLRyXKZXwAOHrjpwSO8sKmVXX0GdVSQA5KG30KzIwIMHvZ4FYtrg==;24:CjcgnY5IXuqCMaK/IjtJNKPD9J7Jt5aDgJtmyizVlvgbKlEIwhCCzTSoUW2JmR/j3u9Mr8Vp1gZisz8Bs9VgAS0LRb2xKBv73LBWeoBLraY=;20:Nm8WTCeE5p2iVodotjEy58+bYH308UFJnFr/cERptuf+ZcI0/Q8UFwxNhPqlZMAICIMwgmCHjYCRE1smt6xKcg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2015 19:58:30.4648 (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: AM3PR02MB0421 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2687 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 c5eca9c99fad..8187b4b4c91c 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -754,7 +754,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, #ifdef CONFIG_NO_HZ_FULL /* Limit the tick delta to the maximum scheduler deferment */ - if (!ts->inidle) + if (!ts->inidle && !tick_nohz_is_cpu_isolated()) delta = min(delta, scheduler_tick_max_deferment()); #endif -- 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/