From patchwork Wed Mar 21 11:48:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 7387 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6644523DEE for ; Wed, 21 Mar 2012 11:48:47 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 13964A1828D for ; Wed, 21 Mar 2012 11:48:46 +0000 (UTC) Received: by ghbz12 with SMTP id z12so1003231ghb.11 for ; Wed, 21 Mar 2012 04:48:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:x-gm-message-state; bh=idgQoliV5yjzyE1MZGgLrRVIf4MJLc/uGOBZRaAlTkY=; b=L6X07yra2MXPAf5W3wEt6GYgUQLekXxbJlAfhGxCbsa/1ufqtidlKHaIj0+9XYtko2 0YLT9Z9G7Qe+uvVUQcOo9lSrUSX/rhsmKA2nkMHz2P2fKr95S0dFrqL1A32LV9N0uV6b sjLPCTZtMjrs4JM13xh2W/K7EoA7KfTPhBRlLwn8RgLcFX6XPzmIdzuTsCP8eSxuhSAc QL5gGOwKN5SxeYef10ZlJCrdT/Kzy+Li0GYyQHNBD1/KvdK2AnDl+aViTKhwMBIqqP4P g09ryXhzJKHe3wV7vcXrJ/QkMDyKWuFcowITiaTiUMuvixvvRKeevdaSBVGFH2JVJFj6 Y/Cw== Received: by 10.50.47.231 with SMTP id g7mr11280761ign.12.1332330526319; Wed, 21 Mar 2012 04:48:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp7859ibb; Wed, 21 Mar 2012 04:48:45 -0700 (PDT) Received: by 10.204.154.153 with SMTP id o25mr1361513bkw.138.1332330525024; Wed, 21 Mar 2012 04:48:45 -0700 (PDT) Received: from mail-bk0-f50.google.com (mail-bk0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id rk10si571368bkb.60.2012.03.21.04.48.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 04:48:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by bkuw11 with SMTP id w11so1166930bku.37 for ; Wed, 21 Mar 2012 04:48:44 -0700 (PDT) Received: by 10.205.135.132 with SMTP id ig4mr1432748bkc.20.1332330524198; Wed, 21 Mar 2012 04:48:44 -0700 (PDT) Received: from linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id u5sm2964578bka.5.2012.03.21.04.48.42 (version=SSLv3 cipher=OTHER); Wed, 21 Mar 2012 04:48:43 -0700 (PDT) Date: Wed, 21 Mar 2012 11:48:40 +0000 From: Dave Martin To: Avik Sil Cc: linaro-big-little@lists.linaro.org, Morten Rasmussen , patches@linaro.org Subject: Re: [Linaro-big-little] [PATCH v2] cpufreq/arm-bl-cpufreq: Add simple cpufreq big.LITTLE switcher frontend Message-ID: <20120321114840.GB2070@linaro.org> References: <1332258545-20223-1-git-send-email-dave.martin@linaro.org> <4F69A962.7060403@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F69A962.7060403@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkzDc2FwGJ5kwGqN/qZLBAhkWFWiMGBUZWNdCtosx+z4+auaXSuW3cdMwf7KHsewayqGCZu On Wed, Mar 21, 2012 at 03:41:46PM +0530, Avik Sil wrote: > With this patch, the default governor is userspace but after one hour of > booting it's switching to performance governor! > > # tail -n 20 /var/log/syslog > Jan 1 00:00:06 linaro-developer kernel: init: ureadahead main process > (614) terminated with status 5 > Jan 1 00:00:06 linaro-developer kernel: EXT4-fs (mmcblk0p2): > re-mounted. Opts: errors=remount-ro > Jan 1 00:00:06 linaro-developer kernel: init: udev-fallback-graphics > main process (789) terminated with status 1 > Jan 1 00:00:06 linaro-developer kernel: init: failsafe main process > (779) killed by TERM signal > Jan 1 00:00:06 linaro-developer cron[826]: (CRON) INFO (pidfile fd = 3) > Jan 1 00:00:06 linaro-developer cron[840]: (CRON) STARTUP (fork ok) > Jan 1 00:00:06 linaro-developer cron[840]: (CRON) INFO (Running @reboot > jobs) > Jan 1 00:00:06 linaro-developer kernel: init: tty1 main process (859) > killed by TERM signal > Jan 1 00:01:06 linaro-developer kernel: ondemand governor failed, too > long transition latency of HW, fallback to performance governor > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: ondemand governor failed, too > long transition latency of HW, fallback to performance governor > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: ondemand governor failed, too > long transition latency of HW, fallback to performance governor > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: ondemand governor failed, too > long transition latency of HW, fallback to performance governor > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 > Jan 1 00:01:06 linaro-developer kernel: arm-bl-cpufreq: Switching to > cluster 0 It looks like something in userspace is trying to change to a different governor after boot. The ondemand governor requires a reasonable estimate for the transition latency in order to work -- currently, I don't bother to set this, so cpufreq falls back to performance. I don't know what is trying to switch governors... if it's not possible to guess, this patch may give you a clue about where it's coming from. Cheers ---Dave diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 987a165..d271664 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -424,6 +425,17 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf) } +static void printk_task_chain(struct task_struct *t) +{ + get_task_struct(t); + if(t->real_parent != NULL && t->real_parent != t && t->pid != 1) { + printk_task_chain(t->real_parent); + printk("->"); + } + printk("%s[%d]", t->comm, t->pid); + put_task_struct(t); +} + /** * store_scaling_governor - store policy for the specified CPU */ @@ -446,6 +458,10 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy, &new_policy.governor)) return -EINVAL; + printk(KERN_INFO "cpufreq: "); + printk_task_chain(current); + printk(": scaling_governor -> %s on CPU%d\n", str_governor, policy->cpu); + /* Do not use cpufreq_set_policy here or the user_policy.max will be wrongly overridden */ ret = __cpufreq_set_policy(policy, &new_policy);