Received: by 10.213.65.68 with SMTP id h4csp293466imn; Tue, 20 Mar 2018 03:50:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELuRe+XxQDMYoKKbb3IpuamQgX+rOfmtTegHTExQzbae/dIBCyEVbwBxQ88QsJHgqyj/5/NQ X-Received: by 2002:a17:902:5328:: with SMTP id b37-v6mr16387477pli.332.1521543048196; Tue, 20 Mar 2018 03:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521543048; cv=none; d=google.com; s=arc-20160816; b=H6Zd66yR77lVX4Opwpz2Lnsszd8e2mB3yPK3bf1YwkrO7W3V4iRAu9SyAGdg9AkS6m dz2Twv00nWK+Dq1D28rb1Ak+BAr2EgBw6zu6XAeJ8fhBmVTvA2txPU6kKkCujmeSz39g OwA/gIAUpm/6CkuU7lKADvQn9NrwH1nNRyftp40bHDJD6NHELmWYElyukLQFXvIYEMEl 9zjeUbE0zqEbXNEx9wgY6+FMogGEeDkoYFXqJ1R3OKg7AxYT3B8+qDwcBgnwecVCEO0k NoMPv31nWcnr8GBjCRLa6kdAbOSnTN0Js6SuR2tRiOrZeq3INvyDIsJd+u7ddL2P/8/m F1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=o+H7rGn3tDtVoe/leq61VtqkAcursvgWCD1eBIqgcF8=; b=HMQxRzemhQfN2v5NWYYHAGS4zmUrGLmewgtTVRXTOBUQTynoP+DL56IgusX6fExS5d u02hMviAhu0gbtrms5JURzRDoMRB4uK40GWvpWAxKqpY15xbQOxWQ5nQ2JNjqsJTYNhr DP5LC2wWtTty8QNGmOWGRRP/9My2JE8NDVagJQTZW0vKpvya81SAeBkZTPID1f8WrVAW 7AmfR4Jl92jIOfUTPsEw5RqpX8d7BHas5qsQXZ48xfqtofZxz/WmvQYMIB/hBtLjBmWi Y3k7IrVbrzmZkAu7F4BRvo+cIbSFhpnxrfqycOQC70RmH8ONwoKP0dl/m2iwtlQT/fBq TB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=NGNb5g5x; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u188si1110744pfb.220.2018.03.20.03.50.32; Tue, 20 Mar 2018 03:50:48 -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=fail header.i=@gmail.com header.s=20161025 header.b=NGNb5g5x; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752575AbeCTKth (ORCPT + 99 others); Tue, 20 Mar 2018 06:49:37 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:33189 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbeCTKtf (ORCPT ); Tue, 20 Mar 2018 06:49:35 -0400 Received: by mail-oi0-f41.google.com with SMTP id e9-v6so918900oii.0; Tue, 20 Mar 2018 03:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=o+H7rGn3tDtVoe/leq61VtqkAcursvgWCD1eBIqgcF8=; b=NGNb5g5xsbrQ299LxojmTdNBZY251phs7RmPaZHANa7OBs4IupQYot/T3LwKAFEU9l V7YtB3qr0oL/kL6TchRE9IpwrRViDP3+urkJ/EWBGXddrJhqNK8VGUKxk5Sn+X01XL9P TKFhqcr0lURcJcbD664GRamGsKzHCmDSjVNhWN2ox9JI9IGL4jAvhRhrXQhmRnn2fuPe H63PxVB8+Em3d5JQyFa/XQINavbx406IW4tDvtvpByEJ7GHbZzGFIEKqKjmckgRTLIQL lgeFMpACvvqQ1ex1NgOWYPgDYPzkJ4hl9zlcpXYef8SouD1tkyPB9Vicu48ZTGJu7fyP XwGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=o+H7rGn3tDtVoe/leq61VtqkAcursvgWCD1eBIqgcF8=; b=KVE9nucJmfSgmdrTTeUT72oElGS6qBiI0fpWFcbKS715BW6CnbT0n6kv/G4yreQPWK OaOAWUmJdO9xIbwp4sXW16nJeBOJ2Aky4Lgnh6puerpeufV4nlHhAzB5BxkLbEyFraGc 9wYIkak5b+r5qf9jpLDpxC/oStER1xFrA2ryUAgEbOjMscuNW4j8O2q5mYs/3SNNtrgX fOsOIkh/iFH3pOzYMvmYxEHu2ldHPZfvsFjtyRdtmIMS4pZYVaCUQTgzjTiQt7zXlj0b 5hbCQYWrgrvKbgS1cVBlsiq/1JgASXubF7eyb9/8zALPy4Nyz5S1HqlRWpAuB48K0IW9 PJvw== X-Gm-Message-State: AElRT7FRSKLtPxLDX5OMY9pLJQeeArQ2Wb8/2sCeZJ1n3cjj5JfMEqyq gdL+WIm4la4nS56EQfPySPD5ICR+rMKMJbfoX/8= X-Received: by 10.202.224.132 with SMTP id x126mr8575728oig.120.1521542975088; Tue, 20 Mar 2018 03:49:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:9f7:0:0:0:0:0 with HTTP; Tue, 20 Mar 2018 03:49:34 -0700 (PDT) In-Reply-To: References: <2142751.3U6XgWyF8u@aspire.rjw.lan> <001a01d3be0a$ad3a0ed0$07ae2c70$@net> <2043615.lCdO10SMaB@aspire.rjw.lan> From: "Rafael J. Wysocki" Date: Tue, 20 Mar 2018 11:49:34 +0100 X-Google-Sender-Auth: uRTSxmhTJ0sSBWdFvWQ9nWWfsAY Message-ID: Subject: Re: [RFT][PATCH v5 0/7] sched/cpuidle: Idle loop rework To: Thomas Ilsche Cc: "Rafael J. Wysocki" , Peter Zijlstra , Doug Smythies , Linux PM , Frederic Weisbecker , Thomas Gleixner , Paul McKenney , Rik van Riel , Aubrey Li , Mike Galbraith , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 20, 2018 at 11:01 AM, Thomas Ilsche wrote: > On 2018-03-18 17:15, Rafael J. Wysocki wrote: >>> >>> Doug, Thomas, >>> >>> Thank you both for the reports, much appreciated! >>> >>> Below is a drop-in v6 replacement for patch [4/7]. >>> >>> With this new patch applied instead of the [4/7] the behavior should be >>> much >>> more in line with the v4 behavior, so please try it if you can and let me >>> know >>> if that really is the case on your systems. >>> >>> Patches [5-7/7] from the original v5 apply on top of it right away for >>> me, >>> but I've also created a git branch you can use to pull all of the series >>> with the below included: >>> >>> git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ >>> idle-loop > > > Thanks for the git repo, that helps alot. I have tested v6 on a > Skylake desktop and server system as well as a Haswell server system. > The odd idle behavior of v5 is gone. Thank you for the report! > Some of the other findings may be obsolete by the upcoming respin, > I will retest. > > Our originally observed Powernightmare pattern is effectively > prevented in both idle and with a synthetic trigger. That's great! > However, I can reproduce simple workloads under which the revised > menu governor wastes energy by going into *deeper* C-states than > advisable. > > Consider the Skylake server system which has residencies in C1E of > 20 us and C6 of 800 us. I use a small while(1) {usleep(300);} > unsynchronized pinned to each core. While this is an artificial > case, it is a very innocent one - easy to predict and regular. Between > vanilla 4.16.0-rc5 and idle-loop/v6, the power consumption increases > from 149.7 W to 158.1 W. On 4.16.0-rc5, the cores sleep almost > entirely in C1E. With the patches applied, the cores spend ~75% of > their sleep time in C6, ~25% in C1E. The average time/usage for C1E is > also lower with v6 at ~350 us rather than the ~550 us in C6 (and in > C1E with the baseline). Generally the new menu governor seems to chose > C1E if the next timer is an enabled sched timer - which occasionally > interrupts the sleep-interval into two C1E sleeps rather than one C6. > > Manually disabling C6, reduces power consumption back to 149.5 W. > > This is far from what I expected, I did not yet figure out why the > patched menu governor decides to go to C6 under that workload. I > have tested this previously with v4 and saw this behavior even > without path "7/7". I see. I'm not sure what the source of this effect is either. If that is also present in the v7 I'm working on now, it should be easier to diagnose in there. > The results from Haswell-EP and Skylake desktop are similar. > > The tests are with a 1000 Hz kernel because I wanted to amplify > effects that happening when C-state residencies and tick timers are > closer together. But I suspect the results will be similar with > 300 Hz as the impact from the sched tick interruption seems to be > minor compared to the odd C-state selection. OK Thanks!