Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp378498img; Thu, 21 Mar 2019 23:27:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDGNFWYjRNWtgP5j5azPmz1KlkFBewaxuCc1gCZ2TsaE5R+xYHkukrTLRTmp+HTxJnuGzw X-Received: by 2002:a17:902:70c9:: with SMTP id l9mr7974498plt.131.1553236022122; Thu, 21 Mar 2019 23:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553236022; cv=none; d=google.com; s=arc-20160816; b=vx4hlOuD0DudYE3se9f2qZaZPMzeC7CHRf6/BfkfBLTgD64m1QBfw4pD0lBs5Ts+Hw YOIZhU1X83Uf/8r26ard50Acd8q7LZw6Na/T95mKsnk4GS3upP61OqE6DrmLXUqBAtvF 1NtLu1ajvkaYtwrVMlGy7qvy6bQUAtjvTKgxyR/Bwgn2sLQW9upKAjWPPPcJz3hRwc6r bpmzncXlpcdZfyJHs0+WpRHvsJUujxynEyhWGuVScu0Tl3dcEPmA1xhRvieEj6J/l4aL vZ9icVG6ZF2168ZxUp+L6s3NuO1gLneBVggZC/k4qrIEsU7P0CqYMHTiaO1GzDbXnJq/ tM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=Ixdq1naTbtsSHmDY59RA/sFr2J250lnrSnKQxwNpDOg=; b=uKkFg/Pwgda0Hpf89cR+r+HT6wK+R3uAGLGiVm2+MI7m6sEZp7vlUgabSVGo0rPvbm pPvWG+ebS81JrhoqwCa7/KeqGJx89zsJTPZlBLUW54fFoZZyY2uywkaXi53NALH3+qlb Y3f7hR/qvNxK0hffk+Fb8R5YBxkDj03d8wJ0P0DUzB26puUFqzuTyRGiIHVoi7lmV2uo okggGEHZBuf7KKP5HxYbRPnjDZ+d8llWpy4pUVDZ6O5/XA7Y+LCzXXh/YIsy6kPlrlR4 4VX4GJDXPXBmk9srf7ScW07u0tV0FNS0KizqA9pnjEW6do4GfXCv2f/LahwrLWFtwLl4 M1kA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si5825514pgv.523.2019.03.21.23.26.46; Thu, 21 Mar 2019 23:27:02 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727602AbfCVG0L (ORCPT + 99 others); Fri, 22 Mar 2019 02:26:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33816 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbfCVG0K (ORCPT ); Fri, 22 Mar 2019 02:26:10 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2M6J7C0127577 for ; Fri, 22 Mar 2019 02:26:09 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rcqbj60ep-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Mar 2019 02:26:08 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Mar 2019 06:25:57 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 22 Mar 2019 06:25:55 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2M6Q3G320775098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2019 06:26:03 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C20AAE053; Fri, 22 Mar 2019 06:26:03 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FEB0AE04D; Fri, 22 Mar 2019 06:26:02 +0000 (GMT) Received: from boston16h.aus.stglabs.ibm.com (unknown [9.3.23.78]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 22 Mar 2019 06:26:02 +0000 (GMT) From: Abhishek Goel To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, daniel.lezcano@linaro.org, mpe@ellerman.id.au, Abhishek Goel Subject: [PATCH 1/2] cpuidle : auto-promotion for cpuidle states Date: Fri, 22 Mar 2019 01:25:29 -0500 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190322062530.7586-1-huntbag@linux.vnet.ibm.com> References: <20190322062530.7586-1-huntbag@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19032206-0020-0000-0000-000003263E74 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19032206-0021-0000-0000-0000217867D0 Message-Id: <20190322062530.7586-2-huntbag@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-22_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903220048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the cpuidle governors (menu /ladder) determine what idle state an idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that the CPU will be busy soon. However, if no new workload is scheduled on that CPU in the near future, the CPU will end up in the shallow state. In case of POWER, this is problematic, when the predicted state in the aforementioned scenario is a lite stop state, as such lite states will inhibit SMT folding, thereby depriving the other threads in the core from using the core resources. To address this, such lite states need to be autopromoted. The cpuidle- core can queue timer to correspond with the residency value of the next available state. Thus leading to auto-promotion to a deeper idle state as soon as possible. Signed-off-by: Abhishek Goel --- drivers/cpuidle/cpuidle.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 2406e2655..c4d1c1b38 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -584,11 +584,8 @@ static void __cpuidle_unregister_device(struct cpuidle_device *dev) static void __cpuidle_device_init(struct cpuidle_device *dev) { - int i; memset(dev->states_usage, 0, sizeof(dev->states_usage)); dev->last_residency = 0; - for (i = 0; i < CPUIDLE_STATE_MAX; i++) - dev->states_usage[i].disable = true; } /** -- 2.17.1