Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1982571ybe; Tue, 3 Sep 2019 06:26:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOncmBZDjIK0M/BmVvX6Wjsqjyw+EoXTg79I2WnysUr2ZidooXLzh+0qUHbDS5rckaRsWK X-Received: by 2002:a17:90a:a116:: with SMTP id s22mr14369358pjp.15.1567517183738; Tue, 03 Sep 2019 06:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567517183; cv=none; d=google.com; s=arc-20160816; b=0fon6SyUFD3uKeZPTnswpS2L3ZZ1YLblqSNoWkrguHuwLNb0a158Bel7l9GB4tgNTP TGyv+l1A81eXtcH9Zc/lZmQ6Dy4XjqFaV26eVHQObksdIJ8mWf6CrFylIoSgqBmRqUaS EPk1He32T9s0yB87O2hJKAazep0NhTRxA9QG8nhfSZFM6E18+Syya1F/ytXsb+YIvFQa Kq+vnhTk55mx/17ywRAQH2+X4QXPNFcJmHuomXkZflZv3E2LCAELaAZLgnQfw3ktoLkc lhA2Uj+zaMOgITVKSX8fUfFRwlzP5dm46qPAAu8UypIubWT17mbBBS8C66Xcwk51EWEj aHjw== 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 :dkim-signature; bh=+VllEEyT4iEiGSQ5dF27BA09Kf2mwJdY7Ifdj5cpMaE=; b=HnTHcqC15oc+zvDwE9qTFPITMD5bQ+TMuf1a1q4prssIFKLVXSskCrhk3fkQWlqeqe /7BD829ABYOJfsXwg7YIWDTKN+soAOtZbtB0SCYnA9qA6xU5gbFadD6vXgTFvZ/2D9LR OK+n1xI207jdJwQEz1tYfpPHkNPWCYzoBU7Oq3B3zif+9GT9l8pIn+38fFEim1vl7taG TK+uEhG4CTUXAU4c/C2r29x1wKPQZG3fIZsH2QYkyqLOF2Sfb3wkavqJ7QhjsVj/aURb Pb8a25SsA2EdxXK0I/PplOMydm9fWD/Y5yMQl0WAy4RaXBFEghX7k8vOTMN0yDNKSx49 OhgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=N5B6PkiJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q128si17723056pfb.192.2019.09.03.06.26.07; Tue, 03 Sep 2019 06:26:23 -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=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=N5B6PkiJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729344AbfICNZJ (ORCPT + 99 others); Tue, 3 Sep 2019 09:25:09 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33548 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729015AbfICNZI (ORCPT ); Tue, 3 Sep 2019 09:25:08 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x83DOBrM042257; Tue, 3 Sep 2019 13:25:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=+VllEEyT4iEiGSQ5dF27BA09Kf2mwJdY7Ifdj5cpMaE=; b=N5B6PkiJt+VTDiKACfjykl3rhZtFTGRAvnf99gPhmKspLwggZAjajpgpEnt2HPMBk14d el+C+0DQMKBDE/qq+U6GIGGwgpCYKo8o9CD3MOSjHVnr/Z+C+0r8W5Nt88WxQnmYmEN+ JWz1v2o4Uo0Cyk2Gyb3Pnm9Ii0xtYm+J8ESK/KJvRzbNQftZKa/zj4m44595Zp+DwUJv dpY53+fm/eHqN5Mr1O8dsMeqWUxQT/qUImccGr1rUcpjjcJtZkDWX3rTuMaSboKaFp1B Zh+4ldG87qW3sgmzBh76j9JyerOu4OmfuofcyL98Noys/CZonsukB9JfHD54YBcVmlkT eQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2usrw8r1f6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Sep 2019 13:24:59 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x83DO3DH164824; Tue, 3 Sep 2019 13:24:59 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2uryv6py59-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Sep 2019 13:24:59 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x83DOw7a016999; Tue, 3 Sep 2019 13:24:58 GMT Received: from paddy.uk.oracle.com (/10.175.205.235) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Sep 2019 06:24:58 -0700 From: Joao Martins To: linux-pm@vger.kernel.org Cc: Joao Martins , "Rafael J. Wysocki" , Daniel Lezcano , linux-kernel@vger.kernel.org, Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH v2 2/4] cpuidle-haltpoll: set haltpoll as preferred governor Date: Tue, 3 Sep 2019 14:24:42 +0100 Message-Id: <20190903132444.11808-3-joao.m.martins@oracle.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190903132444.11808-1-joao.m.martins@oracle.com> References: <20190903132444.11808-1-joao.m.martins@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9368 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=359 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909030142 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9368 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=412 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909030142 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Right now, guest current governors have the following ratings: * ladder -> 10 * teo -> 19 * menu -> 20 * haltpoll -> 21 * ladder + nohz=off -> 25 haltpoll governor got introduced and it is now the default governor given its highest rating -- with ladder+nohz being the exception -- regardless of idle driver in the guest. An example of an undesirable case is x86 KVM guests with MWAIT which have intel_idle registered first, and consequently will have haltpoll be used as governor which would get limited to a poll state and state 1 and the other states wouldn't get used. To keep the previous defaults we decrease rating of governor to 9 (below current lowest rating) and thus rely on @governor switch on cpuidle_register_driver() to tie in haltpoll idle driver and governor together. Signed-off-by: Joao Martins --- drivers/cpuidle/cpuidle-haltpoll.c | 1 + drivers/cpuidle/governors/haltpoll.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index 56d8ab814466..519e90d125cf 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -34,6 +34,7 @@ static int default_enter_idle(struct cpuidle_device *dev, static struct cpuidle_driver haltpoll_driver = { .name = "haltpoll", + .governor = "haltpoll", .owner = THIS_MODULE, .states = { { /* entry 0 is for polling */ }, diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c index 797477bda486..7a703d2e0064 100644 --- a/drivers/cpuidle/governors/haltpoll.c +++ b/drivers/cpuidle/governors/haltpoll.c @@ -133,7 +133,7 @@ static int haltpoll_enable_device(struct cpuidle_driver *drv, static struct cpuidle_governor haltpoll_governor = { .name = "haltpoll", - .rating = 21, + .rating = 9, .enable = haltpoll_enable_device, .select = haltpoll_select, .reflect = haltpoll_reflect, -- 2.17.1