Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754553AbbGXUVq (ORCPT ); Fri, 24 Jul 2015 16:21:46 -0400 Received: from mail-db3on0083.outbound.protection.outlook.com ([157.55.234.83]:2132 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752745AbbGXUVn (ORCPT ); Fri, 24 Jul 2015 16:21:43 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; Subject: Re: [PATCH v4 1/5] nohz_full: add support for "cpu_isolated" mode To: Frederic Weisbecker References: <1436817481-8732-1-git-send-email-cmetcalf@ezchip.com> <1436817481-8732-2-git-send-email-cmetcalf@ezchip.com> <20150724132659.GA20091@lerouge> CC: Gilad Ben Yossef , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Tejun Heo , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , , , From: Chris Metcalf Message-ID: <55B29E49.5090305@ezchip.com> Date: Fri, 24 Jul 2015 16:21:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150724132659.GA20091@lerouge> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BLUPR07CA0031.namprd07.prod.outlook.com (10.255.223.144) To DB5PR02MB0775.eurprd02.prod.outlook.com (25.161.243.146) X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0775;2:OaH1NGBlMpaBHLDuGLqo2/5H7vHMQuVvu3NFRgdZ/DQasDv3DglQCT25Mpt2A2a4;3:lkj2NOiVCz9K/wiffB2Lj4iZUth928CLklLRlek7ltnC7GlxbTeEiEgdH2DozcEit01IQ/m+QnYkcjIaLCslsxl50TbQc6n4G54eYbLkk9asFkbMhhkYnofT8TVL7OhOicYZh62jq8naY/TIabAe+A==;25:odm0Xi/AOzlep+hxHD1HEwCQ9gWkE55HXlwiX3TYjARqzxnyoKDuofyMezmgPV0atuwXK4uuDomEvuxV0GZLAZPC6S6rCjcSFRn8Tb1f8vaQ8WyjezGRgrYRxQezjrxgqe2YBVFhGv5dRQesHfUqjdfgIoKNxG113P0S3LPmfrSs4yVd01en04fd5B460pje1M8804udhKgnipaEsXX5M8J14Pmj7qNn1oDnRebQHyIu/Ainj3TIoGDTm02uqOpUt6PfPqP2fqZgB4PZhak1kw==;20:Fn+VNSZ4kqjlNk8xToPlLmrMjph6HmxEIsQb/rzVb7f38vwFT5YLKUPmEm3KSs3j6oCi4c80mLyGWsq+xp8pcT41xGSNipYQmncxKQQmoLxh05WCR4kBRfsRfA/ENJK5Ww+SQr+gLUpCjJbLBeXC/Azz6s+p53v9NE6GkBVLvnk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; DB5PR02MB0775: 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:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0775;4:1OG42ogXc0mcKdOZE7ohIS0lx/XgUl2cjCOSOce/A3UbXS/uFyTL4IUYhq490ETImp5LclCwdXEMQosy6x1+e8vVoOsdPE6NXMVMxJCWlHK8+n8zpvdprRxy/XlOWi9HK+6MKQBwZt8me3bRSMOlYOkWidCnS1o+tok8AWu683hxsSY4kD3kHatR8uuVEk8qXQcC1omlf+ENXJQcoTM/n//tBWCkUw9PigNuJZstYMLOc5SmD4Dr3mBGA+8fky8AUKH91g4V9Qo63q2lcx7grB5OLBR2v13Zu+C7YpsuhM8= X-Forefront-PRVS: 0647963F84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(6009001)(377454003)(479174004)(24454002)(36756003)(80316001)(54356999)(189998001)(86362001)(83506001)(92566002)(47776003)(5001960100002)(76176999)(33656002)(65806001)(50986999)(77096005)(19580395003)(42186005)(110136002)(1411001)(46102003)(62966003)(2950100001)(40100003)(65816999)(66066001)(4001350100001)(15975445007)(65956001)(122386002)(77156002)(23746002)(87976001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:[10.7.0.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DB5PR02MB0775;23:PPMbgO6jxEHTVK/111shO4vVY8JD6PuCYV13T?= =?Windows-1252?Q?BluKMFLXdskJBA8brbSWSfn1yCcfMJw8xWGFBtiDZN5Z9znbU/k4aGXt?= =?Windows-1252?Q?UAALxyDASLiPsNa55k1pNDSdrPcVGb5HRKXoh9tzL+M3dCmJITHItxf+?= =?Windows-1252?Q?6TQiauXckTktoVgni9XRsy1UCeyDv9pMayBtRranowPT+CxNFAUfhsL4?= =?Windows-1252?Q?EugUU3mq+/cjVds3FttwbxeYZoH76gGvEvym/Vz0WMZdI+5Y4WAbI7rF?= =?Windows-1252?Q?MTMjKf3eJoie/BA83PPugs59vOv/8kfObvR2owLkscqZt9lZXNM3B2UO?= =?Windows-1252?Q?o4HdhN3er1swhE0ChWAB+c9na+7TkvmNaxEzfgx5OzYsNUF3tSV1XZXG?= =?Windows-1252?Q?BQ0o2ZZuGS7d2GwPi48yZI8So1vIErXlyBHuHAYpL9BBJRLnlsNMQZ3u?= =?Windows-1252?Q?76b54SOBuNahKM4gqmtmzlLOG+6QBSzrAJNjL5gEdzs9Gu76t9nnpaEE?= =?Windows-1252?Q?KVD7HhSFROAT3hjg7/TmT3l/kVt6BkJIGGTfxXMuihX6HFEIZzbxRccV?= =?Windows-1252?Q?GdpFXVwBANffUwZ7TqNMi5jF/xkGpVkqnKBzjkzGMp1SjDkyimpjDRKY?= =?Windows-1252?Q?aRLdkHTFtBMCGXVIMXjlQEqRt3qyCGIfOOTmnvCgGVFckJMbq+tzmp65?= =?Windows-1252?Q?yqopVeSyMsnz4UCcF6cfk9IBNvIdScGUgALpys270EMgfMR7URih7QJp?= =?Windows-1252?Q?k27939OrO9Dvq0u4ng6n1EoASCtars8bvKo3pFcekseWFccN+NsOfnTJ?= =?Windows-1252?Q?l0r9JLGxdrEEPOgOoCp1KTx+rVVopPuOkeg/VyCroEfzbVwOP587/bH1?= =?Windows-1252?Q?YTKjIYqmPx+0WRcJJXqfFWYR287dxLCQbuCrTJPLAwwGygDOPfkM1XnG?= =?Windows-1252?Q?UPT5DnpK34HNryfxQC7bfAKibyqkK2g/bmNNX++ZWZHECDzM5HHDbupw?= =?Windows-1252?Q?qOtipghqbr835pA4xYpSbIjxzT2FZYZunt5Vpabpf7jBcA4xof6m0re3?= =?Windows-1252?Q?Ki01hZqQvFfZuU=3D?= X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0775;5:dF+VhCwzxuwYDDGqLV2qXbOuAzJxKJ19Lpm9mXRl45hS+4jkndZAleitCuFJpNRJwJFiFSCZxSfNmmxyla9Q6hnJdIpSYxpAyfttcfvcgU9qQizHx7zuwvob/1ftiqFV0fY3oHGs7ujD11mMb4BKdQ==;24:R7EY8tUVw0LL+RN2bUwVWxmgtD+ajsLHZ/KH/9BmzWK3hO8XGmess8JnxHivnEqj+zgn1zrw/luhx2QKqCvDQt4988VsSBY7efo9ioSHopI=;20:dgwSz+NAdwJKViqNvMPucqPIjzZa/HiICJFDw59tKtYh7YRIFXiPsLukQn7Z3IzGApKQ9TuJKR6q23b2DxdGdw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2015 20:21:39.1036 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0775 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2150 Lines: 53 On 07/24/2015 09:27 AM, Frederic Weisbecker wrote: > On Mon, Jul 13, 2015 at 03:57:57PM -0400, Chris Metcalf wrote: >> +{ >> + struct clock_event_device *dev = >> + __this_cpu_read(tick_cpu_device.evtdev); >> + struct task_struct *task = current; >> + unsigned long start = jiffies; >> + bool warned = false; >> + >> + /* Drain the pagevecs to avoid unnecessary IPI flushes later. */ >> + lru_add_drain(); >> + >> + while (READ_ONCE(dev->next_event.tv64) != KTIME_MAX) { >> + if (!warned && (jiffies - start) >= (5 * HZ)) { >> + pr_warn("%s/%d: cpu %d: cpu_isolated task blocked for %ld seconds\n", >> + task->comm, task->pid, smp_processor_id(), >> + (jiffies - start) / HZ); >> + warned = true; >> + } >> + if (should_resched()) >> + schedule(); >> + if (test_thread_flag(TIF_SIGPENDING)) >> + break; >> + tick_nohz_cpu_isolated_wait(); > If we call cpu_idle(), what is going to wake the CPU up if no further interrupt happen? > > We could either implement some sort of tick waiters with proper wake up once the CPU sees > no tick to schedule. Arguably this is all risky because this involve a scheduler wake up > and thus the risk for new noise. But it might work. > > Another possibility is an msleep() based wait. But that's about the same, maybe even worse > due to repetitive wake ups. The presumption here is that it is not possible to have tick_cpu_device have a pending next_event without also having a timer interrupt pending to go off. That certainly seems to be true on the architectures I have looked at. Do we think that might ever not be the case? We are running here with interrupts disabled, so this core won't transition from "timer interrupt scheduled" to "no timer interrupt scheduled" before we spin or idle, and presumably no other core can reach across and turn off our timer interrupt either. -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com -- 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/