From patchwork Mon Jan 11 16:41:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 8006701 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7DDBF9F1C0 for ; Mon, 11 Jan 2016 16:42:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4ED920295 for ; Mon, 11 Jan 2016 16:42:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AC102028D for ; Mon, 11 Jan 2016 16:42:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761189AbcAKQmB (ORCPT ); Mon, 11 Jan 2016 11:42:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:50088 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761187AbcAKQmA (ORCPT ); Mon, 11 Jan 2016 11:42:00 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0F5F4AD69; Mon, 11 Jan 2016 16:41:58 +0000 (UTC) Date: Mon, 11 Jan 2016 17:41:53 +0100 From: Jean Delvare To: linux-pm@vger.kernel.org Cc: Thomas Gleixner , Zhang Rui , "Rafael J. Wysocki" , Daniel Lezcano Subject: [PATCH 2/3] cpuidle: Default to ladder governor on ticking systems Message-ID: <20160111174153.3918f419@endymion.delvare> In-Reply-To: <20160111173915.63ec1bcd@endymion.delvare> References: <20160111173915.63ec1bcd@endymion.delvare> Organization: SUSE Linux X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.23; x86_64-suse-linux-gnu) MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The menu governor is currently the default on all systems. However the documentation claims that the ladder governor is preferred on ticking systems. So bump the rating of the ladder governor when NO_HZ is disabled, or when booting with nohz=off. This fixes the first half of bug #65531: https://bugzilla.kernel.org/show_bug.cgi?id=65531 Signed-off-by: Jean Delvare Cc: "Rafael J. Wysocki" Cc: Daniel Lezcano Cc: Zhang Rui --- drivers/cpuidle/governors/ladder.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- linux-4.4.orig/drivers/cpuidle/governors/ladder.c 2016-01-11 16:14:57.962027330 +0100 +++ linux-4.4/drivers/cpuidle/governors/ladder.c 2016-01-11 16:15:57.217301178 +0100 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -184,6 +185,14 @@ static struct cpuidle_governor ladder_go */ static int __init init_ladder(void) { + /* + * When NO_HZ is disabled, or when booting with nohz=off, the ladder + * governor is better so give it a higher rating than the menu + * governor. + */ + if (!tick_nohz_enabled) + ladder_governor.rating = 25; + return cpuidle_register_governor(&ladder_governor); }