Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1048366imm; Tue, 5 Jun 2018 08:21:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuqjGX4Bzys0Jk5cBN4v1fEMoChx7L9fut5QCAw0jXFX/GSVtj4EyYalMDTee5Xv8ukBPB X-Received: by 2002:a63:a702:: with SMTP id d2-v6mr21750874pgf.246.1528212063687; Tue, 05 Jun 2018 08:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528212063; cv=none; d=google.com; s=arc-20160816; b=n1v9iB+zQn3J6goiV0B0KyGv0ct8loIvpa/izbo3V3pY85Wx9GWSEhAtl1Ln3sNQTd yGv7a+05EwoJsqTUq7oVBg+KXyK5btJCvbIrmgOZN53h+eut/kaOeMuZXiB+efZV885y fj9cQ0W6O36EGrICb1rRPpy7YhjetQ/xKA8vQMrFLtaLpveJO4ymnQjE1TFKfZJ4gwN9 lwYL6HcHytlCjD4MYTWtcqPOwuZedAizfug5U5Jjr/nnjpBoEOpgFUI/Yf1bZhHym0eJ X/xCGCMyA06WfY74/teKeYl1K9ig0OJji7XxoILb8ebnHriU4aZoNZwzdyswWCdz9oXA YmTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=T08GH27FoQ+PRapmrnsYNui/xEiv7o5+oMBPrINO0Oc=; b=D53aX5NRMUzezH3tgDMVDlpAnFgVEHFNVjwXB2bxftEYPrUKxlxE6UOQ8Fy6p5YArY iX2nKyRujc/pzHvH7t1qH+WHS1gKFsAQhW+FQdOA6WexF/FTAVappC/VkJxbG9Sx3UB/ PhtNRnVA+xJgdtGXuTDg27a90VPRfbNusH+dhyOEhtJxakInDttUQwr8XraTmw3kzwSG aes9c2Qr599FgwUzbJoRFaWsvguPHFCnGrNpB3kCYeQJ8cr23jC4IjHPgzKjuzLMOFTS wU7VdCyVrY2uoeihVmhekGFGvPfDqr3CvcaLIZvadMtVwDgE/YphH7tQPc/XPqtGSUP4 HPNQ== 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 n4-v6si8200645plp.128.2018.06.05.08.20.49; Tue, 05 Jun 2018 08:21:03 -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; 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 S1752067AbeFEPTj (ORCPT + 99 others); Tue, 5 Jun 2018 11:19:39 -0400 Received: from ozlabs.org ([203.11.71.1]:52987 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbeFEPTf (ORCPT ); Tue, 5 Jun 2018 11:19:35 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 410b7m522wz9s47; Wed, 6 Jun 2018 01:19:32 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 0a4ec6aa035a52c422eceb2ed51ed88392a3d6c2 In-Reply-To: <1527768909-32637-1-git-send-email-ego@linux.vnet.ibm.com> To: "Gautham R. Shenoy" , "Rafael J. Wysocki" , Daniel Lezcano , Stewart Smith , Michael Neuling , Vaidyanathan Srinivasan , Shilpasri G Bhat , Akshay Adiga , Nicholas Piggin From: Michael Ellerman Cc: "Gautham R. Shenoy" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: cpuidle:powernv: Make the snooze timeout dynamic. Message-Id: <410b7m522wz9s47@ozlabs.org> Date: Wed, 6 Jun 2018 01:19:32 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-05-31 at 12:15:09 UTC, "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of > snooze to deeper idle state") introduced a timeout for the snooze idle > state so that it could be eventually be promoted to a deeper idle > state. The snooze timeout value is static and set to the target > residency of the next idle state, which would train the cpuidle > governor to pick the next idle state eventually. > > The unfortunate side-effect of this is that if the next idle state(s) > is disabled, the CPU will forever remain in snooze, despite the fact > that the system is completely idle, and other deeper idle states are > available. > > This patch fixes the issue by dynamically setting the snooze timeout > to the target residency of the next enabled state on the device. > > Before Patch > Reviewed-by: Balbir Singh > > ================== > POWER8 : Only nap disabled. > $cpupower monitor sleep 30 > sleep took 30.01297 seconds and exited with status 0 > |Idle_Stats > PKG |CORE|CPU | snoo | Nap | Fast > 0| 8| 0| 96.41| 0.00| 0.00 > 0| 8| 1| 96.43| 0.00| 0.00 > 0| 8| 2| 96.47| 0.00| 0.00 > 0| 8| 3| 96.35| 0.00| 0.00 > 0| 8| 4| 96.37| 0.00| 0.00 > 0| 8| 5| 96.37| 0.00| 0.00 > 0| 8| 6| 96.47| 0.00| 0.00 > 0| 8| 7| 96.47| 0.00| 0.00 > > POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1, > stop2) disabled: > $cpupower monitor sleep 30 > sleep took 30.05033 seconds and exited with status 0 > |Idle_Stats > PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop > 0| 16| 0| 89.79| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 > 0| 16| 1| 90.12| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 > 0| 16| 2| 90.21| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 > 0| 16| 3| 90.29| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00 > > After Patch > ====================== > POWER8 : Only nap disabled. > $ cpupower monitor sleep 30 > sleep took 30.01200 seconds and exited with status 0 > |Idle_Stats > PKG |CORE|CPU | snoo | Nap | Fast > 0| 8| 0| 16.58| 0.00| 77.21 > 0| 8| 1| 18.42| 0.00| 75.38 > 0| 8| 2| 4.70| 0.00| 94.09 > 0| 8| 3| 17.06| 0.00| 81.73 > 0| 8| 4| 3.06| 0.00| 95.73 > 0| 8| 5| 7.00| 0.00| 96.80 > 0| 8| 6| 1.00| 0.00| 98.79 > 0| 8| 7| 5.62| 0.00| 94.17 > > POWER9: Shallow states (stop0lite, stop1lite, stop2lite, stop0, stop1, > stop2) disabled: > > $cpupower monitor sleep 30 > sleep took 30.02110 seconds and exited with status 0 > |Idle_Stats > PKG |CORE|CPU | snoo | stop | stop | stop | stop | stop | stop | stop | stop > 0| 0| 0| 0.69| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 9.39| 89.70 > 0| 0| 1| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.05| 93.21 > 0| 0| 2| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 89.93 > 0| 0| 3| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 0.00| 93.26 > > Signed-off-by: Gautham R. Shenoy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0a4ec6aa035a52c422eceb2ed51ed8 cheers