Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3221197imu; Sat, 24 Nov 2018 00:26:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xx3COp4EqgLx354dxeNIuimiQDc0jeXNhlGFV3+jGWNyfLu3nFye/5Mbv7FFjSxuw9OGQQ X-Received: by 2002:a17:902:2a0a:: with SMTP id i10mr18818215plb.323.1543047968259; Sat, 24 Nov 2018 00:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543047968; cv=none; d=google.com; s=arc-20160816; b=Q5ObRD4Jbhhnqh3Xy7KBZt8qbBW56aZsQ5WO6laBIB0bRQAVq6ZxAags8TnYx7sp+i 4jhNVwCckiW/y3NGnDHRJOiCN9ALawAlogCBowqx1HDSKmB/o4Tx7YJPIorf9i+Zff8I zMkDEGKl3fNOG6YTP1Ks+NPVvtHuFOUFfEmFAHSgBJjgEJcZVGgq60BNYxdNgxOOhwxL affQ5HMDsBpHBZHjfB/prmIrzHvdnmPKpGOVZID3CvxDbVTvuDKmwBg8bfwc28YDWaPl ulKVdaTnVeHZQ3yG74sHfLE+mhI9rV4QiwY/x1UE9QM3jeTtTEJYDmf3Egu+FyHUFt2S 0gKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cSB1JLDD92SA32R8Tm5ziw+QQu7mka2YPVES6Txf20Y=; b=NJj5UGM3qTHI3nCDLURFPzmizDvaJbiZH+bAaE7+AMShrhi4+2ttRfbadfPB9QNe3L 2AjtSLu78US9KTEEmonQJC6M57ydFK3aaopeBOSioFxJjezxlPr3dAPJHe3LdMn2lDIu UepGa6Eq4slZu37PP9WA83ML78kaxOCiotnPzhvsJAMg5cq7HtlBEJMyvwQEQ2bDBX4c zOFrsHHeWmgfQMNzspKLAH5CGjp1tNKXM0XJkmrfOIfbBEvE4NP1qtpf7JcQh6AOwqKN 9OwOcZcRd/Dwi7PNC2zDtHAN6UA0IQ6qQQLz7XkRBy7mEwS9gVU9ZpbpmcmWsx/1WBVe o0nQ== ARC-Authentication-Results: i=1; mx.google.com; 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 205si46042911pfa.199.2018.11.24.00.25.53; Sat, 24 Nov 2018 00:26:08 -0800 (PST) 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; 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 S2503325AbeKWVYd (ORCPT + 99 others); Fri, 23 Nov 2018 16:24:33 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:58670 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394186AbeKWVYd (ORCPT ); Fri, 23 Nov 2018 16:24:33 -0500 Received: from 79.184.254.110.ipv4.supernova.orange.pl (79.184.254.110) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.157) id c4516cd8d735a65b; Fri, 23 Nov 2018 11:40:46 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: Giovanni Gherdovich , Doug Smythies , Srinivas Pandruvada , Peter Zijlstra , LKML , Frederic Weisbecker , Mel Gorman , Daniel Lezcano Subject: Re: [RFC/RFT][PATCH v6] cpuidle: New timer events oriented governor for tickless systems Date: Fri, 23 Nov 2018 11:40:47 +0100 Message-ID: <4066059.ijq7GCtu0s@aspire.rjw.lan> In-Reply-To: <42865872.dmYH3PmblP@aspire.rjw.lan> References: <42865872.dmYH3PmblP@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, November 23, 2018 11:35:38 AM CET Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The venerable menu governor does some thigns that are quite > questionable in my view. > > First, it includes timer wakeups in the pattern detection data and > mixes them up with wakeups from other sources which in some cases > causes it to expect what essentially would be a timer wakeup in a > time frame in which no timer wakeups are possible (becuase it knows > the time until the next timer event and that is later than the > expected wakeup time). > > Second, it uses the extra exit latency limit based on the predicted > idle duration and depending on the number of tasks waiting on I/O, > even though those tasks may run on a different CPU when they are > woken up. Moreover, the time ranges used by it for the sleep length > correction factors depend on whether or not there are tasks waiting > on I/O, which again doesn't imply anything in particular, and they > are not correlated to the list of available idle states in any way > whatever. > > Also, the pattern detection code in menu may end up considering > values that are too large to matter at all, in which cases running > it is a waste of time. > > A major rework of the menu governor would be required to address > these issues and the performance of at least some workloads (tuned > specifically to the current behavior of the menu governor) is likely > to suffer from that. It is thus better to introduce an entirely new > governor without them and let everybody use the governor that works > better with their actual workloads. > > The new governor introduced here, the timer events oriented (TEO) > governor, uses the same basic strategy as menu: it always tries to > find the deepest idle state that can be used in the given conditions. > However, it applies a different approach to that problem. > > First, it doesn't use "correction factors" for the time till the > closest timer, but instead it tries to correlate the measured idle > duration values with the available idle states and use that > information to pick up the idle state that is most likely to "match" > the upcoming CPU idle interval. > > Second, it doesn't take the number of "I/O waiters" into account at > all and the pattern detection code in it avoids taking timer wakeups > into account. It also only uses idle duration values less than the > current time till the closest timer (with the tick excluded) for that > purpose. > > Signed-off-by: Rafael J. Wysocki > --- > > v5 -> v6: > * Avoid applying poll_time_limit to non-polling idle states by mistake. > * Use idle duration measured by the governor for everything (as it likely is > more accurate than the one measured by the core). This particular change is actually missing, sorry about that. It is not essential, however, so the v6 should be good enough as is for evaluation and review purposes. > * Rename SPIKE to PULSE. > * Do not run pattern detection upfront. Instead, use recent idle duration > values to refine the state selection after finding a candidate idle state. > * Do not use the expected idle duration as an extra latency constraint > (exit latency is less than the target residency for all of the idle states > known to me anyway, so this doesn't change anything in practice). Thanks, Rafael