Received: by 10.213.65.68 with SMTP id h4csp1182626imn; Wed, 21 Mar 2018 04:53:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELtRmtIrXSYx22kLTeYUdIkKS7yo738lqZz9NFAfc9lWiGrNKYlijNOPDwl81il9bgMPI6A+ X-Received: by 10.99.45.131 with SMTP id t125mr10271376pgt.267.1521633209065; Wed, 21 Mar 2018 04:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521633209; cv=none; d=google.com; s=arc-20160816; b=vbBTUjjaUYp/A+uFmw8TlmJXTa5ldcQycb53QTd+Qfqg4dKQcvfZBrEVpbZqp27xgY cxWwHyEExjUGHCiimoZPbU4MBI7wlSoJHJnSBECa3dTbm7E10bqOvSSfX2ehoGBm21fY EqJP9MqyrqIhHtxcQ1FIzLKyJgqn1Ru5JQc85WiOKDo0pqKP+XYuT3TUrUoCu5NmHgeS NiZpTTXkup54sFdxRroiZfyr5IVxeDah959nxsXukpVkz8UlOVjrvxikHd40dL/dIXlM Wz7As2wQpxUdYzlBBuXlIfblSLUMfvnssPfzVUa2LWgxQQZm+381IyIwrL+aME84yip5 XMxw== 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=n86Ne5VImV2bDeU0wNzTFn2A5qWS82fuxIThtalK2BA=; b=DH1Nz2FgIx5x7zg+D53A13jQuuKN3QGlaELKF3s3ZlOSmXWpRZ4nAdvl/FZZXj+bpg 9AXc3lOmFd+5XO13UP5qOmrtXk+KofkgiCdpaRk7Ykrw713YPFosT9x+dMpQ16Z7D/oq LLv6jDZTnXqjE/etNAry1lv7NNatoX1aaQAVVU0DSZsWQq20TuYreDK+jhjp3eYJCduk t1UTbKfVFgAqDAof5UCfzKHs4CfD3TPG+q8ihdEZZ+/UrBC2tpPyyKdlORFXKKpCAiwA NWaeyaHDNnb+zZI+i+KXZD/yj528+BZ9CgL5Texn+EiW9u37G1FqL7L4UKi3DctVG2ic Q9eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MLCKwkiv; 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 124si170323pfe.15.2018.03.21.04.53.14; Wed, 21 Mar 2018 04:53:29 -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=MLCKwkiv; 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 S1751687AbeCULwY (ORCPT + 99 others); Wed, 21 Mar 2018 07:52:24 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:43732 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbeCULwW (ORCPT ); Wed, 21 Mar 2018 07:52:22 -0400 Received: by mail-ot0-f196.google.com with SMTP id m22-v6so5249756otf.10; Wed, 21 Mar 2018 04:52:22 -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=n86Ne5VImV2bDeU0wNzTFn2A5qWS82fuxIThtalK2BA=; b=MLCKwkiv5xHnmDj0Lnex1D770AIOEYc7CbKG94Mu6wzgOPnc3sOs+a6cf7EqbLLt28 Y16UeTa57xtlI//dEjoeaLHFu9tuQgrC5Rk1gVJMY4CD3a1SaL7rNbYRUdh4w4jb9il3 u/ueySTfrGxoKREXweWj76/S8gAy/dP82JxHxIYwCs2VAlv4uhLmzaUt3EWIGH4SSYGc Dxt0/m6HVUg8FQQC6B3b1+VOIxJwhZslAOVPDDItrJ9FUjcXqnSsLUXbFCk8JzuACzfX QcUP4A80o3vcB6kqagls+MYA7Q/p5DHqx9k2V0abMD3v0fmytYOuBuMbDm76rhBSWYpF iNrg== 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=n86Ne5VImV2bDeU0wNzTFn2A5qWS82fuxIThtalK2BA=; b=rOpKn/vyLNOGz6AhCEl44WHEERGXANV1+krILq9onAG08KIVlK5D5OVMUKZGcw3J6K 7yMJPZ56WALN7OXnonJI1ejP9w+X4l5R3EohP9pKpSrjx31SR8qsVYBqaIar/wRqpTx2 22QJlvnq67G+cLfp+RJIh/BKiy5s63E5vNzZ4tRKiaq76QwEQn4E2UMjkb4nbsXMO6u6 A5jFWnRQHb9/wBNwLbFcNbOoyccD6Uit/gfYxN/1v3Fm2grmyCBSELgA2oDaLxw2HlFg fWSrMHBfDwhTunqJSWZiQN5prv5xLK+x0GBACznqav9HjUgZBEZoL5ruiTCM8QiaMOEt MT5g== X-Gm-Message-State: AElRT7FhL9mKc0eXzSokykZJeGgZ8WnJ13GdWDN/WrJzSy1XLyjn/CN/ ei3PABgiE1aY7BCsqmoY4jnAPQSAAn3wRRmyFnQ= X-Received: by 2002:a9d:5c7:: with SMTP id 65-v6mr12315909otd.364.1521633142194; Wed, 21 Mar 2018 04:52:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:9f7:0:0:0:0:0 with HTTP; Wed, 21 Mar 2018 04:52:21 -0700 (PDT) In-Reply-To: <2111949.c172CzMuf8@aspire.rjw.lan> References: <2390019.oHdSGtR3EE@aspire.rjw.lan> <1635957.yuHkCe9oyz@aspire.rjw.lan> <2111949.c172CzMuf8@aspire.rjw.lan> From: "Rafael J. Wysocki" Date: Wed, 21 Mar 2018 12:52:21 +0100 X-Google-Sender-Auth: iQJrAQGWE_pnigLti7Sq6-II7Mw Message-ID: Subject: Re: [RFT][PATCH v7.1 5/8] cpuidle: Return nohz hint from cpuidle_select() To: "Rafael J. Wysocki" Cc: Peter Zijlstra , Linux PM , Frederic Weisbecker , Thomas Gleixner , Paul McKenney , Thomas Ilsche , Doug Smythies , 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 Wed, Mar 21, 2018 at 7:48 AM, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Add a new pointer argument to cpuidle_select() and to the ->select > cpuidle governor callback to allow a boolean value indicating > whether or not the tick should be stopped before entering the > selected state to be returned from there. > > Make the ladder governor ignore that pointer (to preserve its > current behavior) and make the menu governor return 'false" through > it if: > (1) the idle exit latency is constrained at 0, or > (2) the selected state is a polling one, or > (3) the expected idle period duration is within the tick period > range. > > In addition to that, the correction factor computations in the menu > governor need to take the possibility that the tick may not be > stopped into account to avoid artificially small correction factor > values. To that end, add a mechanism to record tick wakeups, as > suggested by Peter Zijlstra, and use it to modify the menu_reflect() > behavior when tick wakeup occurs. Namely, if the CPU is woken up by > the tick, the predicted idle duration is likely too short, so make > menu_reflect() try to compensate by bumping up the correction factor > with a (sufficiently large) constant value. > > Since the value returned through the new argument pointer of > cpuidle_select() is not used by its caller yet, this change by > itself is not expected to alter the functionality of the code. > > Signed-off-by: Rafael J. Wysocki > --- > > Another variant of patch [5/8] to test. > > This one doesn't run menu_update() at all on tick wakeups, but simply > bumps up the correction factor alone then. I have overlooked one thing in this patch and in the original v7 of it. Namely, tick wakeups occurring when the return value of tick_nohz_get_sleep_length() is within the tick boundary should be treated as normal wakeups, because the nohz code itself doesn't stop the tick then even without this patch series. I'll rework this patch for that and will send an update shortly. Thanks!