Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4653864imm; Mon, 15 Oct 2018 20:01:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60vluHQAUim1mchJFiz9CqoDOQV9ef/I/zm4yotewM9HLHBFXSwAzNlODbfy+qZb22YmgFJ X-Received: by 2002:a62:120b:: with SMTP id a11-v6mr20207849pfj.165.1539658872526; Mon, 15 Oct 2018 20:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539658872; cv=none; d=google.com; s=arc-20160816; b=wEx/Emr3ZxxCge51qivH4mHsVIPuuwWrBNJRUCWQcywbNvmjfikZvViWAdl6kRUk3x IRsgP3oyrn5D62wxaN/9Tr0C5f07WZotVXlOa3XpISQSjadtSBr95twoGUNGsqGbb3aA anY+BmD2YJLWlqPbBsWaEoQTcT36gVt92sScwwuFO5pK5uDRjRU5eS9wuYURUEQjMX2L KTJrPTTTAM/CINyFlGf4cwadON7vN/L9X9QTMxEmOUdpDfWcLTRcRexhsrdYh92HRDvd M40plUfkVfrdndhBmZUsUmwc8w1jrjEjeqOqNtBtyasmrfLC4hCY1DjKo5aUpeHPKr/X OU7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=t1gOsh75WUxcZYvjc07vOycHBwroG3MAnWujiwR0v1Y=; b=vHSTGwi1hv2PPEA18mJmoFCruf+dm4Xt6IHiUmtQa77tCUVJMDQNyCzgWOztBnAr/2 GILGYB2mq05E/rGYY9B2JRhGhS/bLC24AzO6v7BplgCS+bl3JazFbfZXHCLiJ5rIRFin kNHWKY0bIfx2d4ITxECyUM0N7VEUf1qm56TgKSv4EQtgH1wLOs22qia9i/TFFmqCWAZK xk6Dopijj8dDIeYHeJ3YOP5rM0ozdXKzDC5iS9ZFijDszEvLOjZn94RCziMP2F4MD6WH 7COgkxpw/84MyGMkyR1E9HG/ZmH4VawDVYgame3lnwN+LkLp8vP84NCCcbLMGI0dsb2W 6kHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@telus.net header.s=neo header.b=thDiejC0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12-v6si13111156pga.81.2018.10.15.20.00.57; Mon, 15 Oct 2018 20:01:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@telus.net header.s=neo header.b=thDiejC0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbeJPKsl (ORCPT + 99 others); Tue, 16 Oct 2018 06:48:41 -0400 Received: from cmta19.telus.net ([209.171.16.92]:58542 "EHLO cmta19.telus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbeJPKsk (ORCPT ); Tue, 16 Oct 2018 06:48:40 -0400 Received: from dougxps ([173.180.45.4]) by cmsmtp with SMTP id CFangdIUmTtUECFaogvZwn; Mon, 15 Oct 2018 21:00:31 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=neo; t=1539658831; bh=t1gOsh75WUxcZYvjc07vOycHBwroG3MAnWujiwR0v1Y=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=thDiejC0QiD1JrRYuX4uWKNrMkaUxAo3VKFJIEL5Z83DIGpWNf5RvY0JVP/2qL0+D ZZuE2R1k86MABC+x93cUewIaxcZEW+OrbfSEGky8Yd7KQm0wdwug1BxIBo52+f0nKk dld1dr5nqVOobl6m+pgJdzc9X+ZU2TKq9vdVBjNqN2SON+SIIH5HuwZlqj+o2MG6Ex 9Zm+iNO2ozCYJ9Qs11BMiQf8XviGg2oR94FYjc5+C7fVWlWt51oc43qkvllR/QmTAq zO1Gwm73waHO25TUxHq/vEcvCxziVweQk6H70i+gEOhcRuwTaDxxmsNgzUKgbFPxfg 17GFaY3XSfgjg== X-Authority-Analysis: v=2.3 cv=a6fhCnaF c=1 sm=1 tr=0 a=zJWegnE7BH9C0Gl4FFgQyA==:117 a=zJWegnE7BH9C0Gl4FFgQyA==:17 a=Pyq9K9CWowscuQLKlpiwfMBGOR0=:19 a=IkcTkHD0fZMA:10 a=aatUQebYAAAA:8 a=FGbulvE0AAAA:8 a=gu6fZOg2AAAA:8 a=4c1hVEeGUr2z-EoRigYA:9 a=QEXdDO2ut3YA:10 a=BBaMYSUnRWwA:10 a=5DLwxePbAi8A:10 a=oCD-iAR9n-0A:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=7715FyvI7WU-l6oqrZBK:22 a=svzTaB3SJmTkU8mK-ULk:22 a=2RSlZUUhi9gRBrsHwhhZ:22 From: "Doug Smythies" To: "'Rafael J. Wysocki'" Cc: "'Rafael J. Wysocki'" , "'Srinivas Pandruvada'" , "'Peter Zijlstra'" , "'Linux Kernel Mailing List'" , "'Frederic Weisbecker'" , "'Mel Gorman'" , "'Giovanni Gherdovich'" , "'Daniel Lezcano'" , "'Linux PM'" , "Doug Smythies" References: <000e01d4638a$91a20c60$b4e62520$@net> BxfmgI8c1ivIDBxfngUxWV In-Reply-To: BxfmgI8c1ivIDBxfngUxWV Subject: RE: [RFC/RFT/[PATCH] cpuidle: New timer events oriented governor for tickless systems Date: Mon, 15 Oct 2018 20:00:19 -0700 Message-ID: <001101d464fc$65623c60$3026b520$@net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-ca Thread-Index: AdRkW//69sOuXx+MRCCqbhBsESk+UAAlZb7A X-CMAE-Envelope: MS4wfFVg3LF5I7UEE53ZDcMWan1YtdwUd9X1fZIece3cwteUN1KTLLak7keC3zRmkAhrKblcAgKZoWVq2Rh6Gs4Cnl/AicXMhtzHxxM31ny/4STPCm9+gMfg fExPmAouyxMXGHVSg51wXnBNPUZjLzPvsbcfpO7g9vBG2jeEH630D6rxmvCiN+kGNacL4UpydzoG+/8DXeVCGS93wjN6I4K+7BOWInKbv1Bn3+B/V6hvhR1L GouLH6HpPsLZ0KARSlOgXa0ddwZ7rs93otBgMijz5R8Yc0lHX8qQMkqhFByFUP3BPCUIFiS5VCwmXa6lpE+ngPNXelvpsEpVHHaM1+1pU1FimL4p/tHuOBYZ FajVYAhNHHJwZVTmX6rK+MRm0Sy1ZiJW/N/9Iqmh+hrAvm38ftnz3CP5vMK/MLjbKUP9zZU89P+9HoQbSmywAfB+mC++PHg4QXXFBBv9H15IELu767sUL5sw JA2Fl6BYtsTQRpSoShvVMxFvGOaK0NCcdVmo5g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018.10.15 00:52 Rafael J. Wysocki wrote: > On Sun, Oct 14, 2018 at 8:53 AM Doug Smythies wrote: >> On 2018.10.11 14:02 Rafael J. Wysocki wrote: > > ...[cut]... > >>> Overall, it selects deeper idle states than menu more often, but >>> that doesn't seem to make a significant difference in the majority >>> of cases. >> >> Not always, that viscous powernightmare sweep test that I run used >> way way more processor package power and spent a staggering amount >> of time in idle state 0. [1]. > > Can you please remind me what exactly the workload is in that test? The problem with my main test computer is that I have never had a good way to make it use idle state 0 and/or idle state 1 a significant amount, while not setting the need-resched flag. Due to the minimum overheads involved, in a tight loop c program calling nanosleep with an only 1 nanosecond argument, will result in about 50 (44 to 57 measured) microseconds, or much too long to invoke idle state 0 or 1 (at least on my test computer). So, for my 8 CPU older model i7-2600K, the idea is to spin out 40 threads doing short sleeps in an attempt to pile up events such that the shallower idle states are invoked more often. Why 40 threads, one might wonder? This was many months ago now, but I tested quite a number of threads, and 40 seemed to provide the most interesting results for this type of work. I have not rechecked it since (probably should). For the testing I did in August for this: "[PATCH] cpuidle: menu: Retain tick when shallow state is selected" [2]. The thinking was to sweep through a wide range of sleep times, and see if anything odd shows up. The test description is copied here: In [2] Doug wrote: > Test 1: A Thomas Ilsche type "powernightmare" test: > (forever ((10 times - variable usec sleep) 0.999 seconds sleep) X 40 staggered > threads. Where the "variable" was from 0.05 to 5 in steps of 0.05, for the first ~200 > minutes of the test. (note: overheads mean that actual loop times are quite > different.) And then from 5 to 500 in steps of 1, for the remaining 1000 minutes of > the test. Each step ran for 2 minutes. The system was idle for 1 minute at the start, > and a few minutes at the end of the graphs. > While called "kernel 4.18", the baseline was actually from mainline at head = > df2def4, or just after Rafael's linux-pm "pm-4.19-rc1-2" merge. > (actually after the next acpi merge). > Reference kernel = df2def4 with the two patches reverted. However, that description was flawed, because there actually was never a long sleep (incompetence on my part, but it doesn't really matter). That test was 1200 minutes, and is worth looking at [3]. Notice how, as the test progresses, a migration through the idle states can be observed, just as expected. The next old reference of this test was the 8 patch set on top of Kernel 4.19-rc6 [4], from a week ago. However, I shortened the test by 900 minutes. Why? Well, there is only so much time in a day. So now, back to the test this thread is about [1]. It might be argued that maybe the TEO governor should be spending more time in idle state 0 near the start of test, as the test shows. Trace data does, maybe, support such an argument, but I haven't had time to dig into it. I also wonder if some of the weirdness later in the test is repeatable or not (re: discussion elsewhere on this thread, now cut, about lack of repeatability). However, I have not had time to repeat the test. Hope this helps, and sorry for any confusion and this long e-mail. ... Doug [1] http://fast.smythies.com/linux-pm/k419/k419-pn-sweep-teo.htm [2] https://marc.info/?l=linux-pm&m=153531591826718&w=2 [3] http://fast.smythies.com/linux-pm/k418-pn-sweep-rjw.htm [4] http://fast.smythies.com/linux-pm/k419/k419-pn-sweep-rjw.htm