From patchwork Mon May 27 21:00:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 17235 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F92C238E8 for ; Mon, 27 May 2013 21:02:09 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id s1sf9070036qcw.2 for ; Mon, 27 May 2013 14:01:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=iScE0YfarB+gq1zJbr/bnvZE5sbNkayT8Q4k2daIEok=; b=VK64Q+a/o8vMEq9NsD5aVDtxhYcLzcmGjfcZSME7f8lUzpATR8UyQujsn/N7332aEU VxomInik4Ls3oM9Rc50I2rg7W0gLU6+5fUS05SarAQaxG8QIryBT8NJAMyGQSTGeWCuD +tJD+bh12lgeh5/20Qztyyjaimy057okX3s7r+Cy3zvyj6sAjrP1ia4LMwsXk+jL5e6w 3eqcH54NW3Ns7imVATFpFWGhpmyn7V4yEjzq0kXObo3slxbk/v9BLvvUxNWdXMRvxeoa 0Eb/XIRTyuktkoUlnabId7PA8v8t+5g9eZ7/FThAsDbGiHpy8DDxwEPjZw1z0u+aeI4e HAOg== X-Received: by 10.224.53.198 with SMTP id n6mr12851906qag.2.1369688463785; Mon, 27 May 2013 14:01:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.131.71 with SMTP id ok7ls3115376qeb.52.gmail; Mon, 27 May 2013 14:01:03 -0700 (PDT) X-Received: by 10.52.16.201 with SMTP id i9mr13522977vdd.58.1369688463626; Mon, 27 May 2013 14:01:03 -0700 (PDT) Received: from mail-vb0-x234.google.com (mail-vb0-x234.google.com [2607:f8b0:400c:c02::234]) by mx.google.com with ESMTPS id l10si17507195vet.28.2013.05.27.14.01.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 14:01:03 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::234; Received: by mail-vb0-f52.google.com with SMTP id p12so3924897vbe.25 for ; Mon, 27 May 2013 14:01:03 -0700 (PDT) X-Received: by 10.58.225.228 with SMTP id rn4mr16179076vec.35.1369688463449; Mon, 27 May 2013 14:01:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp12410vcb; Mon, 27 May 2013 14:01:02 -0700 (PDT) X-Received: by 10.180.11.176 with SMTP id r16mr9597229wib.58.1369688462035; Mon, 27 May 2013 14:01:02 -0700 (PDT) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [2a00:1450:400c:c00::22c]) by mx.google.com with ESMTPS id h14si4985016wjq.60.2013.05.27.14.01.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 14:01:02 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22c is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=2a00:1450:400c:c00::22c; Received: by mail-wg0-f44.google.com with SMTP id a12so4657908wgh.23 for ; Mon, 27 May 2013 14:01:01 -0700 (PDT) X-Received: by 10.180.210.225 with SMTP id mx1mr9755374wic.15.1369688461656; Mon, 27 May 2013 14:01:01 -0700 (PDT) Received: from mai.home (AToulouse-654-1-312-57.w86-199.abo.wanadoo.fr. [86.199.95.57]) by mx.google.com with ESMTPSA id x13sm20141160wib.3.2013.05.27.14.00.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 14:01:00 -0700 (PDT) From: Daniel Lezcano To: rjw@sisk.pl Cc: linux-pm@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH] cpuidle: improve governor Kconfig options Date: Mon, 27 May 2013 23:00:58 +0200 Message-Id: <1369688458-9114-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmsOJvkfL4vA9ONhSTYuaFfTEvMTiSlzSOFJUd3xLrvSLtJy2kNgWvDiTiJWSiwUOtWhRrN X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Each governor is suitable for different kernel configurations: the menu governor suits better for a tickless system, while the ladder governor fits better for a periodic timer tick system. The Kconfig does not allow to [un]select a governor, thus both are compiled in the kernel but the init order makes the menu governor to be the last one to be registered, so becoming the default. The only way to switch back to the ladder governor is to enable the sysfs governor switch in the kernel command line. Because it seems nobody complained about this, the menu governor is used by default most of the time on the system, having both governors is not really necessary on a tickless system but there isn't a config option to disable one or another governor. Create a submenu for cpuidle and add a label for each governor, so we can see the option in the menu config and enable/disable it. The governors will be enabled depending on the CONFIG_NO_HZ option: - If CONFIG_NO_HZ is set, then the menu governor is selected and the ladder governor is optional, defaulting to 'no' - If CONFIG_NO_HZ is not set, then the ladder governor is selected and the menu governor is optional, defaulting to 'no' Signed-off-by: Daniel Lezcano --- drivers/cpuidle/Kconfig | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index c4cc27e..90c2f39 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -1,7 +1,9 @@ -config CPU_IDLE +menuconfig CPU_IDLE bool "CPU idle PM support" default y if ACPI || PPC_PSERIES + select CPU_IDLE_GOV_LADDER if (!NO_HZ && !NO_HZ_IDLE) + select CPU_IDLE_GOV_MENU if (NO_HZ || NO_HZ_IDLE) help CPU idle is a generic framework for supporting software-controlled idle processor power management. It includes modular cross-platform @@ -9,9 +11,10 @@ config CPU_IDLE If you're using an ACPI-enabled platform, you should say Y here. +if CPU_IDLE + config CPU_IDLE_MULTIPLE_DRIVERS bool "Support multiple cpuidle drivers" - depends on CPU_IDLE default n help Allows the cpuidle framework to use different drivers for each CPU. @@ -19,24 +22,19 @@ config CPU_IDLE_MULTIPLE_DRIVERS states. If unsure say N. config CPU_IDLE_GOV_LADDER - bool - depends on CPU_IDLE - default y + bool "Ladder governor (for periodic timer tick)" + default n if (NO_HZ || NO_HZ_IDLE) config CPU_IDLE_GOV_MENU - bool - depends on CPU_IDLE && NO_HZ - default y + bool "Menu governor (for tickless system)" + default n if (!NO_HZ && !NO_HZ_IDLE) config ARCH_NEEDS_CPU_IDLE_COUPLED def_bool n -if CPU_IDLE - config CPU_IDLE_CALXEDA bool "CPU Idle Driver for Calxeda processors" depends on ARCH_HIGHBANK help Select this to enable cpuidle on Calxeda processors. - endif