Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp596652imu; Thu, 22 Nov 2018 02:27:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xb7OeZvnS5yPhcfRDmyAIg/ZB5AdmM4cd2FwLBOhjjmLIpZBZegpK9P9PfGh5P2V3VPV7J X-Received: by 2002:a63:6cc:: with SMTP id 195mr9648463pgg.52.1542882422802; Thu, 22 Nov 2018 02:27:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542882422; cv=none; d=google.com; s=arc-20160816; b=csdr1AQF80YbnSP9+r+uLiZRWlgY9DFRauyRTYtlnK3logmbEWDDOFmMgRuU4BQ2fb v1wLnQplCdZ1oJ/i5RzwyxWg+rAInOG0Zt75ELpvrnCCqcGu2eGcayJf0mQ24Grf0rSO fUCKkdCHm/3j08BlCOmUeeTJg7FSJiTlJJg7UfV1z/GTHrT5AIpSEwSGHXWKeeMFLlrt vikKA0ZHsq65h0A9CkEpRNIG/zAjE7O1eCbJWqhen1fUO8ZjjU7xMZQksySiU9c52GkA 7V/FhWWaBf+kGasWsD+qGFcNObVCSHdvbJmPLh1PMsLyomuQuNzCXd7y9Vgm9X5uC1ys 3SQQ== 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=XvVrMvddFJ6sWpGYcf0YGulcf1LbIYOq8vAmmgql2cY=; b=Zo5Rk5rurDXTQhIYv7Z73ukXZ5z3GaCJjZhGHNGnt4S3hBV5buQI8jIH86OX79jCSj 5xkcJztOvJ0lvjOVL9coOB0YCx5rDaEhlmu1AZi0dZ8lVE44i9JaSrz/RBEM/t9Dg5UU vdC0mrKY6r1fN8OT9jiKAKGk7DqZINEVxUWPbHBrHH/5oQXAid4zrDmBOsIUvb06FBuA MaJ2ZXVYIjnParDn03k783TvtG2X5lvKEsZkdioUV08L5GgeeOXKdXDNm/dlNu7FszB6 JNL2ibu2Knna4SbNw5ip7UZVkxCud9nZ86b794K9Ju5SH84U3B3AG9hmMO8kvScpnoDS 1lFQ== 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 a128-v6si57483395pfb.24.2018.11.22.02.26.47; Thu, 22 Nov 2018 02:27:02 -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 S2390651AbeKVKUk (ORCPT + 99 others); Thu, 22 Nov 2018 05:20:40 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:47787 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387923AbeKVKUk (ORCPT ); Thu, 22 Nov 2018 05:20:40 -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 434de29f7b835983; Thu, 22 Nov 2018 00:44:03 +0100 From: "Rafael J. Wysocki" To: Peter Zijlstra Cc: "Rafael J. Wysocki" , Linux PM , Giovanni Gherdovich , Doug Smythies , Srinivas Pandruvada , LKML , Frederic Weisbecker , Mel Gorman , Daniel Lezcano Subject: Re: [RFC/RFT][PATCH v5] cpuidle: New timer events oriented governor for tickless systems Date: Thu, 22 Nov 2018 00:44:06 +0100 Message-ID: <2788286.KFAUdKNhO2@aspire.rjw.lan> In-Reply-To: <3270197.PFh8UsvZCP@aspire.rjw.lan> References: <102783770.7hZjAahU8c@aspire.rjw.lan> <20181111154017.GD3021@worktop> <3270197.PFh8UsvZCP@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 Thursday, November 15, 2018 4:15:59 AM CET Rafael J. Wysocki wrote: > On Sunday, November 11, 2018 4:40:17 PM CET Peter Zijlstra wrote: [cut] > > > Anyway; a fair while ago I proposed a different estimator. I've not had > > time to dig through the 4 prior versions so I cannot tell if you've > > already tried this, but the idea was simple: > > > > - track the last @n wakeup distances in the @idle-states buckets; > > - sum the buckets in increasing idle state and pick the state before > > you reach 50% of @n. > > > > That is computationally cheaper than what you have; and should allow you > > to increase @n without making the computation more expensive. > > I can do something similar (actually, I have a prototype ready already), > but do it after walking the idle states once (which will give us a preliminary > idle state choice based on the time to the closest timer and the "history") > and then sum the buckets below the idle state selected so far in the decreasing > order (that will tend to select a shallower state in "tie" situations). I did that, but the result was not encouraging as it caused state 0 (polling) to be selected way too often (and the total time spent in it was significantly greater too). I have gone back to averaging over the most recent observed idle duration values, but now I'm doing that after selecting a candidate idle state (based on the time to the closest timer and the "history") and only taking values below the target residency of that state into account. Seems to work reasonably well. I'll send a v6 tomorrow if all goes well.