* Re: [PATCH 3/6] cgroup: introduce cgroup_taskset and use it in subsys->can_attach(), cancel_attach() and attach()
From: Tejun Heo @ 2011-08-25 8:20 UTC (permalink / raw)
To: KAMEZAWA Hiroyuki
Cc: Daisuke Nishimura, containers, lizf, linux-kernel, James Morris,
linux-pm, paul
In-Reply-To: <20110825093958.75b95bd8.kamezawa.hiroyu@jp.fujitsu.com>
Hello, KAMEZAWA.
On Thu, Aug 25, 2011 at 09:39:58AM +0900, KAMEZAWA Hiroyuki wrote:
> > +Called prior to moving one or more tasks into a cgroup; if the
> > +subsystem returns an error, this will abort the attach operation.
> > +@tset contains the tasks to be attached and is guaranteed to have at
> > +least one task in it. If there are multiple, it's guaranteed that all
> > +are from the same thread group,
>
>
> Do this, "If there are multiple, it's guaranteed that all
> are from the same thread group ", means the 'tset' contains
> only one mm_struct ?
Yes, CLONE_THREAD requires CLONE_SIGHAND which in turn requires
CLONE_VM, so they'll all have the same mm.
> And is it guaranteed that any task in tset will not be freed while
> subsystem routine runs ?
Yeap, that one is guaranteed. It might die but the the task_struct
itself won't be released. However, I think it might be bette to block
task exits during migration too.
> > @@ -5460,8 +5460,9 @@ static void mem_cgroup_clear_mc(void)
> >
> > static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
> > struct cgroup *cgroup,
> > - struct task_struct *p)
> > + struct cgroup_taskset *tset)
> > {
> > + struct task_struct *p = cgroup_taskset_first(tset);
> > int ret = 0;
> > struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
> >
>
> Ah..hmm. I think this doesn't work as expected for memcg.
> Maybe code like this will be required.
Hmmm... the above is basically identity transformation of the existing
code. If the above is broken, the current code is broken too. Is it?
Thanks.
--
tejun
^ permalink raw reply
* [git pull] cpupowerutils patches for 3.1-rc4
From: Dominik Brodowski @ 2011-08-25 7:26 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-pm, cpufreq
Linus,
a few cpupower improvements for 3.1-rc4 are available in the git repository
at:
git://git.kernel.org/pub/scm/linux/kernel/git/brodo/cpupowerutils.git master
Please pull from that location. The diffstat and list of changes is below.
Thanks,
Dominik
Amerigo Wang (1):
cpupower: avoid using symlinks
Dave Jones (1):
cpupower: fix Makefile typo
Dominik Brodowski (2):
cpupower: make NLS truly optional
cpupower: use man(1) when calling "cpupower help subcommand"
Thomas Renninger (4):
cpupower: mperf monitor - Use TSC to calculate max frequency if possible
cpupower: Do not show an empty Idle_Stats monitor if no idle driver is available
cpupower: Better detect offlined CPUs
cpupower: Make monitor command -c/--cpu aware
tools/power/cpupower/Makefile | 7 +-
tools/power/cpupower/debug/x86_64/Makefile | 8 +-
.../power/cpupower/debug/x86_64/centrino-decode.c | 1 -
.../cpupower/debug/x86_64/powernow-k8-decode.c | 1 -
tools/power/cpupower/man/cpupower-frequency-info.1 | 6 +-
tools/power/cpupower/man/cpupower-frequency-set.1 | 8 +-
tools/power/cpupower/man/cpupower.1 | 14 +-
tools/power/cpupower/utils/builtin.h | 7 -
tools/power/cpupower/utils/cpufreq-info.c | 42 +-----
tools/power/cpupower/utils/cpufreq-set.c | 29 +---
tools/power/cpupower/utils/cpuidle-info.c | 24 +---
tools/power/cpupower/utils/cpupower-info.c | 20 +--
tools/power/cpupower/utils/cpupower-set.c | 25 +---
tools/power/cpupower/utils/cpupower.c | 91 ++++++-----
tools/power/cpupower/utils/helpers/helpers.h | 12 ++
tools/power/cpupower/utils/helpers/sysfs.c | 50 ++++++
tools/power/cpupower/utils/helpers/sysfs.h | 2 +
tools/power/cpupower/utils/helpers/topology.c | 5 +-
.../cpupower/utils/idle_monitor/cpuidle_sysfs.c | 2 +-
.../cpupower/utils/idle_monitor/cpupower-monitor.c | 66 ++++----
.../cpupower/utils/idle_monitor/mperf_monitor.c | 177 ++++++++++++++-----
21 files changed, 308 insertions(+), 289 deletions(-)
delete mode 120000 tools/power/cpupower/debug/x86_64/centrino-decode.c
delete mode 120000 tools/power/cpupower/debug/x86_64/powernow-k8-decode.c
^ permalink raw reply
* Re: [PATCH v2] Add regulator driver for the bq2407x family of charger ICs.
From: MyungJoo Ham @ 2011-08-25 6:55 UTC (permalink / raw)
To: Heiko Stübner; +Cc: linux-pm, Mark Brown, Liam Girdwood
In-Reply-To: <201108242048.27461.heiko@sntech.de>
On Thu, Aug 25, 2011 at 3:48 AM, Heiko Stübner <heiko@sntech.de> wrote:
> This driver controls a TI bq2407x charger attached via GPIOs.
> The provided current regulator can enable/disable charging and
> select between 100 mA, 500 mA and a machine specific current limit.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
>
Hello,
This looks like a bq24022 driver + max-current-mode ("USB standby"
seems not implemented in the driver). Wouldn't it be possible to patch
bq24022 driver so that the bq24022 driver becomes compatible with this
bq2407x?
2407x's EN1 = 24022's iset2
2407x's nce = 24022's nce
I think you may simply let the driver ignore EN2 (and max-current
mode) if the supplied EN2 in pdata is NULL, then, the driver will be
compatible for both.
Cheers,
MyungJoo
> ---
> Changes since v1:
> - add private struct to keep track of gpio states
> - get max_uA from regulator_init_data
> (no need to define it twice)
> - disallow setting current limix below 100mA
>
> drivers/regulator/Kconfig | 8 +
> drivers/regulator/Makefile | 1 +
> drivers/regulator/bq2407x.c | 264 +++++++++++++++++++++++++++++++++++++
> include/linux/regulator/bq2407x.h | 35 +++++
> 4 files changed, 308 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> index c7fd2c0..921e271 100644
> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -72,6 +72,14 @@ config REGULATOR_BQ24022
> charging select between 100 mA and 500 mA charging current
> limit.
>
> +config REGULATOR_BQ2407x
> + tristate "TI bq2407x Li-Ion Charger IC"
> + help
> + This driver controls a TI bq2407x Charger attached via
> + GPIOs. The provided current regulator can enable/disable
> + charging select between 100 mA, 500 mA and a machine specific
> + charging current limit.
> +
> config REGULATOR_MAX1586
> tristate "Maxim 1586/1587 voltage regulator"
> depends on I2C
> diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
> index 040d5aa..ce65493 100644
> --- a/drivers/regulator/Makefile
> +++ b/drivers/regulator/Makefile
> @@ -10,6 +10,7 @@ obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
>
> obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
> obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
> +obj-$(CONFIG_REGULATOR_BQ2407x) += bq2407x.o
> obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
> obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
> obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
> diff --git a/drivers/regulator/bq2407x.c b/drivers/regulator/bq2407x.c
> new file mode 100644
> index 0000000..a8221d5
> --- /dev/null
> +++ b/drivers/regulator/bq2407x.c
> @@ -0,0 +1,264 @@
> +/*
> + * Support for TI bq2407x USB-friendly
> + * Li-Ion Charger connected via GPIOs.
> + *
> + * Copyright (c) 2011 Heiko Stuebner
> + *
> + * based on the bq24022 driver
> + * Copyright (c) 2008 Philipp Zabel
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/err.h>
> +#include <linux/module.h>
> +#include <linux/slab.h>
> +#include <linux/gpio.h>
> +#include <linux/regulator/bq2407x.h>
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/machine.h>
> +
> +struct bq2407x {
> + struct regulator_dev *rdev;
> +
> + int gpio_nce;
> + int gpio_en2;
> + int gpio_en1;
> +
> + int state_nce;
> + int state_en2;
> + int state_en1;
> +
> + int max_uA;
> +};
> +
> +
> +static int bq2407x_set_current_limit(struct regulator_dev *rdev,
> + int min_uA, int max_uA)
> +{
> + struct bq2407x *bq = rdev_get_drvdata(rdev);
> +
> + if (bq->max_uA && bq->max_uA > 500000
> + && max_uA >= bq->max_uA) {
> + dev_dbg(rdev_get_dev(rdev),
> + "setting current limit to %d mA\n",
> + bq->max_uA / 1000);
> + gpio_set_value(bq->gpio_en2, 1);
> + bq->state_en2 = 1;
> + gpio_set_value(bq->gpio_en1, 0);
> + bq->state_en1 = 0;
> + } else if (max_uA >= 500000) {
> + dev_dbg(rdev_get_dev(rdev),
> + "setting current limit to 500 mA\n");
> + gpio_set_value(bq->gpio_en2, 0);
> + bq->state_en2 = 0;
> + gpio_set_value(bq->gpio_en1, 1);
> + bq->state_en1 = 1;
> + } else if (max_uA >= 100000) {
> + dev_dbg(rdev_get_dev(rdev),
> + "setting current limit to 100 mA\n");
> + gpio_set_value(bq->gpio_en2, 0);
> + bq->state_en2 = 0;
> + gpio_set_value(bq->gpio_en1, 0);
> + bq->state_en1 = 0;
> + } else {
> + dev_err(rdev_get_dev(rdev), "cannot set current limit below 100 mA\n");
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
> +static int bq2407x_get_current_limit(struct regulator_dev *rdev)
> +{
> + struct bq2407x *bq = rdev_get_drvdata(rdev);
> +
> + if (bq->state_en2 && bq->state_en1)
> + return 0;
> + else if (bq->state_en2 && !bq->state_en1)
> + return bq->max_uA;
> + else if (!bq->state_en2 && bq->state_en1)
> + return 500000;
> + else
> + return 100000;
> +}
> +
> +static int bq2407x_enable(struct regulator_dev *rdev)
> +{
> + struct bq2407x *bq = rdev_get_drvdata(rdev);
> +
> + dev_dbg(rdev_get_dev(rdev), "enabling charger\n");
> +
> + gpio_set_value(bq->gpio_nce, 0);
> + bq->state_nce = 0;
> +
> + return 0;
> +}
> +
> +static int bq2407x_disable(struct regulator_dev *rdev)
> +{
> + struct bq2407x *bq = rdev_get_drvdata(rdev);
> +
> + dev_dbg(rdev_get_dev(rdev), "disabling charger\n");
> +
> + gpio_set_value(bq->gpio_nce, 1);
> + bq->state_nce = 1;
> +
> + return 0;
> +}
> +
> +static int bq2407x_is_enabled(struct regulator_dev *rdev)
> +{
> + struct bq2407x *bq = rdev_get_drvdata(rdev);
> +
> + return !bq->state_nce;
> +}
> +
> +static struct regulator_ops bq2407x_ops = {
> + .set_current_limit = bq2407x_set_current_limit,
> + .get_current_limit = bq2407x_get_current_limit,
> + .enable = bq2407x_enable,
> + .disable = bq2407x_disable,
> + .is_enabled = bq2407x_is_enabled,
> +};
> +
> +static struct regulator_desc bq2407x_desc = {
> + .name = "bq2407x",
> + .ops = &bq2407x_ops,
> + .type = REGULATOR_CURRENT,
> + .owner = THIS_MODULE,
> +};
> +
> +static int __init bq2407x_probe(struct platform_device *pdev)
> +{
> + struct bq2407x_mach_info *pdata = pdev->dev.platform_data;
> + struct bq2407x *bq;
> + int ret;
> +
> + if (!pdata || !pdata->gpio_nce || !pdata->gpio_en1 || !pdata->gpio_en2)
> + return -EINVAL;
> +
> + bq = kzalloc(sizeof(struct bq2407x), GFP_KERNEL);
> + if (!bq) {
> + dev_err(&pdev->dev, "cannot allocate memory\n");
> + return -ENOMEM;
> + }
> +
> + ret = gpio_request(pdata->gpio_nce, "ncharge_en");
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't request nCE GPIO: %d\n",
> + pdata->gpio_nce);
> + goto err_ce;
> + }
> + ret = gpio_request(pdata->gpio_en2, "charge_mode_en2");
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't request EN2 GPIO: %d\n",
> + pdata->gpio_en2);
> + goto err_en2;
> + }
> + ret = gpio_request(pdata->gpio_en1, "charge_mode_en1");
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't request EN1 GPIO: %d\n",
> + pdata->gpio_en1);
> + goto err_en1;
> + }
> +
> + /* set initial current to 100mA and disable regulator */
> + ret = gpio_direction_output(pdata->gpio_en2, 0);
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't set EN2 GPIO: %d\n",
> + pdata->gpio_en1);
> + goto err_reg;
> + }
> + bq->gpio_en2 = pdata->gpio_en2;
> + bq->state_en2 = 0;
> + ret = gpio_direction_output(pdata->gpio_en1, 0);
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't set EN1 GPIO: %d\n",
> + pdata->gpio_en1);
> + goto err_reg;
> + }
> + bq->gpio_en1 = pdata->gpio_en1;
> + bq->state_en1 = 0;
> + ret = gpio_direction_output(pdata->gpio_nce, 1);
> + if (ret) {
> + dev_dbg(&pdev->dev, "couldn't set nCE GPIO: %d\n",
> + pdata->gpio_en1);
> + goto err_reg;
> + }
> + bq->gpio_nce = pdata->gpio_nce;
> + bq->state_nce = 1;
> +
> + /* get maximum current from regulator_init_data */
> + if (pdata->init_data) {
> + bq->max_uA = pdata->init_data->constraints.max_uA;
> + dev_dbg(&pdev->dev, "maximum current is %d mA\n",
> + bq->max_uA / 1000);
> + }
> +
> + bq->rdev = regulator_register(&bq2407x_desc, &pdev->dev,
> + pdata->init_data, bq);
> + if (IS_ERR(bq->rdev)) {
> + dev_dbg(&pdev->dev, "couldn't register regulator\n");
> + ret = PTR_ERR(bq->rdev);
> + goto err_reg;
> + }
> +
> + platform_set_drvdata(pdev, bq);
> + dev_dbg(&pdev->dev, "registered regulator\n");
> +
> + return 0;
> +err_reg:
> + gpio_free(pdata->gpio_en1);
> +err_en1:
> + gpio_free(pdata->gpio_en2);
> +err_en2:
> + gpio_free(pdata->gpio_nce);
> +err_ce:
> + kfree(bq);
> + return ret;
> +}
> +
> +static int __devexit bq2407x_remove(struct platform_device *pdev)
> +{
> + struct bq2407x *bq = platform_get_drvdata(pdev);
> +
> + regulator_unregister(bq->rdev);
> + gpio_free(bq->gpio_en1);
> + gpio_free(bq->gpio_en2);
> + gpio_free(bq->gpio_nce);
> +
> + kfree(bq);
> +
> + return 0;
> +}
> +
> +static struct platform_driver bq2407x_driver = {
> + .driver = {
> + .name = "bq2407x",
> + },
> + .remove = __devexit_p(bq2407x_remove),
> +};
> +
> +static int __init bq2407x_init(void)
> +{
> + return platform_driver_probe(&bq2407x_driver, bq2407x_probe);
> +}
> +
> +static void __exit bq2407x_exit(void)
> +{
> + platform_driver_unregister(&bq2407x_driver);
> +}
> +
> +module_init(bq2407x_init);
> +module_exit(bq2407x_exit);
> +
> +MODULE_AUTHOR("Heiko Stuebner");
> +MODULE_DESCRIPTION("TI bq2407x Li-Ion Charger driver");
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/regulator/bq2407x.h b/include/linux/regulator/bq2407x.h
> new file mode 100644
> index 0000000..14d6d93
> --- /dev/null
> +++ b/include/linux/regulator/bq2407x.h
> @@ -0,0 +1,35 @@
> +/*
> + * Support for TI bq2407x 1.5A USB-friendly
> + * Li-Ion Charger connected via GPIOs.
> + *
> + * Copyright (c) 2011 Heiko Stuebner
> + *
> + * based on the bq24022 driver
> + * Copyright (c) 2008 Philipp Zabel
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +struct regulator_init_data;
> +
> +/**
> + * bq2407x_mach_info - platform data for bq2407x
> + * @gpio_nce: GPIO line connected to the nCE pin, used to control charging
> + * @gpio_en2: GPIO line connected to the EN2 pin, used to limit charging
> + * @gpio_en1: GPIO line connected to the EN1 pin, used to limit charging
> + * @max_uA: maximum current defined by resistor on ILIM connector
> + * Modes of operation:
> + * EN2 = 0, EN1 = 0: 100mA
> + * EN2 = 0, EN1 = 1: 500mA
> + * EN2 = 1, EN1 = 0: max_current
> + * EN2 = 1, EN1 = 1: Standby (usb suspend)
> + */
> +struct bq2407x_mach_info {
> + int gpio_nce;
> + int gpio_en2;
> + int gpio_en1;
> + struct regulator_init_data *init_data;
> +};
> --
> tg: (93ee7a9..) topic/drivers/bq2407x (depends on: master)
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
>
--
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab, DMC Business, Samsung Electronics
^ permalink raw reply
* Re: [PATCH 2/2 v2] sh-sci / PM: Use power.irq_safe
From: Paul Mundt @ 2011-08-25 1:33 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux PM mailing list, LKML, linux-sh
In-Reply-To: <201108242252.25098.rjw@sisk.pl>
On Wed, Aug 24, 2011 at 10:52:24PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, August 24, 2011, Paul Mundt wrote:
> > On Sun, Aug 21, 2011 at 09:11:44PM +0200, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > >
> > > Since sci_port_enable() and sci_port_disable() may be run with
> > > interrupts off and they execute pm_runtime_get_sync() and
> > > pm_runtime_put_sync(), respectively, the SCI device's
> > > power.irq_safe flags has to be used to indicate that it is safe
> > > to execute runtime PM callbacks for this device with interrupts off.
> > >
> > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > Not sure how you want this one handled. Did you simply want to roll this
> > in with your other patch with my Acked-by, or should I be taking this
> > through my tree already regardless of the 1/2 patch?
>
> I'd prefer to push it through my tree, if you don't mind. Magnus has
> already acked it for me, hopefully that's OK?
>
Sure, sounds fine to me. I'll just ignore it then.
^ permalink raw reply
* Re: [PATCH 3/6] cgroup: introduce cgroup_taskset and use it in subsys->can_attach(), cancel_attach() and attach()
From: KAMEZAWA Hiroyuki @ 2011-08-25 0:39 UTC (permalink / raw)
To: Tejun Heo
Cc: Daisuke Nishimura, containers, lizf, linux-kernel, James Morris,
linux-pm, paul
In-Reply-To: <1314138000-2049-4-git-send-email-tj@kernel.org>
On Wed, 24 Aug 2011 00:19:57 +0200
Tejun Heo <tj@kernel.org> wrote:
> Currently, there's no way to pass multiple tasks to cgroup_subsys
> methods necessitating the need for separate per-process and per-task
> methods. This patch introduces cgroup_taskset which can be used to
> pass multiple tasks and their associated cgroups to cgroup_subsys
> methods.
>
> Three methods - can_attach(), cancel_attach() and attach() - are
> converted to use cgroup_taskset. This unifies passed parameters so
> that all methods have access to all information. Conversions in this
> patchset are identical and don't introduce any behavior change.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Paul Menage <paul@paulmenage.org>
> Cc: Li Zefan <lizf@cn.fujitsu.com>
> Cc: Balbir Singh <bsingharora@gmail.com>
> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: James Morris <jmorris@namei.org>
Thank you for your work. I welcome this !
Some comments around memcg.
> ---
> Documentation/cgroups/cgroups.txt | 26 ++++++----
> include/linux/cgroup.h | 28 +++++++++-
> kernel/cgroup.c | 99 +++++++++++++++++++++++++++++++++----
> kernel/cgroup_freezer.c | 2 +-
> kernel/cpuset.c | 18 ++++---
> mm/memcontrol.c | 16 +++---
> security/device_cgroup.c | 7 ++-
> 7 files changed, 153 insertions(+), 43 deletions(-)
>
> diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
> index cd67e90..2eee7cf 100644
> --- a/Documentation/cgroups/cgroups.txt
> +++ b/Documentation/cgroups/cgroups.txt
> @@ -594,16 +594,21 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be
> called multiple times against a cgroup.
>
> int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct task_struct *task)
> + struct cgroup_taskset *tset)
> (cgroup_mutex held by caller)
>
> -Called prior to moving a task into a cgroup; if the subsystem
> -returns an error, this will abort the attach operation. If a NULL
> -task is passed, then a successful result indicates that *any*
> -unspecified task can be moved into the cgroup. Note that this isn't
> +Called prior to moving one or more tasks into a cgroup; if the
> +subsystem returns an error, this will abort the attach operation.
> +@tset contains the tasks to be attached and is guaranteed to have at
> +least one task in it. If there are multiple, it's guaranteed that all
> +are from the same thread group,
Do this, "If there are multiple, it's guaranteed that all
are from the same thread group ", means the 'tset' contains
only one mm_struct ?
And is it guaranteed that any task in tset will not be freed while
subsystem routine runs ?
> @tset contains all tasks from the
> +group whether they're actually switching cgroup or not, and the first
> +task is the leader. Each @tset entry also contains the task's old
> +cgroup and tasks which aren't switching cgroup can be skipped easily
> +using the cgroup_taskset_for_each() iterator. Note that this isn't
> called on a fork. If this method returns 0 (success) then this should
> -remain valid while the caller holds cgroup_mutex and it is ensured that either
> -attach() or cancel_attach() will be called in future.
> +remain valid while the caller holds cgroup_mutex and it is ensured
> +that either attach() or cancel_attach() will be called in future.
>
> int can_attach_task(struct cgroup *cgrp, struct task_struct *tsk);
> (cgroup_mutex held by caller)
> @@ -613,14 +618,14 @@ attached (possibly many when using cgroup_attach_proc). Called after
> can_attach.
>
> void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct task_struct *task, bool threadgroup)
> + struct cgroup_taskset *tset)
> (cgroup_mutex held by caller)
>
> Called when a task attach operation has failed after can_attach() has succeeded.
> A subsystem whose can_attach() has some side-effects should provide this
> function, so that the subsystem can implement a rollback. If not, not necessary.
> This will be called only about subsystems whose can_attach() operation have
> -succeeded.
> +succeeded. The parameters are identical to can_attach().
>
> void pre_attach(struct cgroup *cgrp);
> (cgroup_mutex held by caller)
> @@ -629,11 +634,12 @@ For any non-per-thread attachment work that needs to happen before
> attach_task. Needed by cpuset.
>
> void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct cgroup *old_cgrp, struct task_struct *task)
> + struct cgroup_taskset *tset)
> (cgroup_mutex held by caller)
>
> Called after the task has been attached to the cgroup, to allow any
> post-attachment activity that requires memory allocations or blocking.
> +The parameters are identical to can_attach().
>
> void attach_task(struct cgroup *cgrp, struct task_struct *tsk);
> (cgroup_mutex held by caller)
> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> index da7e4bc..2470c8e 100644
> --- a/include/linux/cgroup.h
> +++ b/include/linux/cgroup.h
> @@ -457,6 +457,28 @@ void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
> void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
>
> /*
> + * Control Group taskset, used to pass around set of tasks to cgroup_subsys
> + * methods.
> + */
> +struct cgroup_taskset;
> +struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
> +struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
> +struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset);
> +int cgroup_taskset_size(struct cgroup_taskset *tset);
> +
> +/**
> + * cgroup_taskset_for_each - iterate cgroup_taskset
> + * @task: the loop cursor
> + * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all
> + * @tset: taskset to iterate
> + */
> +#define cgroup_taskset_for_each(task, skip_cgrp, tset) \
> + for ((task) = cgroup_taskset_first((tset)); (task); \
> + (task) = cgroup_taskset_next((tset))) \
> + if (!(skip_cgrp) || \
> + cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp))
> +
> +/*
> * Control Group subsystem type.
> * See Documentation/cgroups/cgroups.txt for details
> */
> @@ -467,14 +489,14 @@ struct cgroup_subsys {
> int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
> void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
> int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct task_struct *tsk);
> + struct cgroup_taskset *tset);
> int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
> void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct task_struct *tsk);
> + struct cgroup_taskset *tset);
> void (*pre_attach)(struct cgroup *cgrp);
> void (*attach_task)(struct cgroup *cgrp, struct task_struct *tsk);
> void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
> - struct cgroup *old_cgrp, struct task_struct *tsk);
> + struct cgroup_taskset *tset);
> void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
> void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
> struct cgroup *old_cgrp, struct task_struct *task);
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index cf5f3e3..474674b 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -1739,11 +1739,85 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
> }
> EXPORT_SYMBOL_GPL(cgroup_path);
>
> +/*
> + * Control Group taskset
> + */
> struct task_and_cgroup {
> struct task_struct *task;
> struct cgroup *cgrp;
> };
>
> +struct cgroup_taskset {
> + struct task_and_cgroup single;
> + struct flex_array *tc_array;
> + int tc_array_len;
> + int idx;
> + struct cgroup *cur_cgrp;
> +};
> +
> +/**
> + * cgroup_taskset_first - reset taskset and return the first task
> + * @tset: taskset of interest
> + *
> + * @tset iteration is initialized and the first task is returned.
> + */
> +struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset)
> +{
> + if (tset->tc_array) {
> + tset->idx = 0;
> + return cgroup_taskset_next(tset);
> + } else {
> + tset->cur_cgrp = tset->single.cgrp;
> + return tset->single.task;
> + }
> +}
> +EXPORT_SYMBOL_GPL(cgroup_taskset_first);
> +
> +/**
> + * cgroup_taskset_next - iterate to the next task in taskset
> + * @tset: taskset of interest
> + *
> + * Return the next task in @tset. Iteration must have been initialized
> + * with cgroup_taskset_first().
> + */
> +struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset)
> +{
> + struct task_and_cgroup *tc;
> +
> + if (!tset->tc_array || tset->idx >= tset->tc_array_len)
> + return NULL;
> +
> + tc = flex_array_get(tset->tc_array, tset->idx++);
> + tset->cur_cgrp = tc->cgrp;
> + return tc->task;
> +}
> +EXPORT_SYMBOL_GPL(cgroup_taskset_next);
> +
> +/**
> + * cgroup_taskset_cur_cgroup - return the matching cgroup for the current task
> + * @tset: taskset of interest
> + *
> + * Return the cgroup for the current (last returned) task of @tset. This
> + * function must be preceded by either cgroup_taskset_first() or
> + * cgroup_taskset_next().
> + */
> +struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset)
> +{
> + return tset->cur_cgrp;
> +}
> +EXPORT_SYMBOL_GPL(cgroup_taskset_cur_cgroup);
> +
> +/**
> + * cgroup_taskset_size - return the number of tasks in taskset
> + * @tset: taskset of interest
> + */
> +int cgroup_taskset_size(struct cgroup_taskset *tset)
> +{
> + return tset->tc_array ? tset->tc_array_len : 1;
> +}
> +EXPORT_SYMBOL_GPL(cgroup_taskset_size);
> +
> +
> /*
> * cgroup_task_migrate - move a task from one cgroup to another.
> *
> @@ -1828,15 +1902,19 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
> struct cgroup_subsys *ss, *failed_ss = NULL;
> struct cgroup *oldcgrp;
> struct cgroupfs_root *root = cgrp->root;
> + struct cgroup_taskset tset = { };
>
> /* Nothing to do if the task is already in that cgroup */
> oldcgrp = task_cgroup_from_root(tsk, root);
> if (cgrp == oldcgrp)
> return 0;
>
> + tset.single.task = tsk;
> + tset.single.cgrp = oldcgrp;
> +
> for_each_subsys(root, ss) {
> if (ss->can_attach) {
> - retval = ss->can_attach(ss, cgrp, tsk);
> + retval = ss->can_attach(ss, cgrp, &tset);
> if (retval) {
> /*
> * Remember on which subsystem the can_attach()
> @@ -1867,7 +1945,7 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
> if (ss->attach_task)
> ss->attach_task(cgrp, tsk);
> if (ss->attach)
> - ss->attach(ss, cgrp, oldcgrp, tsk);
> + ss->attach(ss, cgrp, &tset);
> }
>
> synchronize_rcu();
> @@ -1889,7 +1967,7 @@ out:
> */
> break;
> if (ss->cancel_attach)
> - ss->cancel_attach(ss, cgrp, tsk);
> + ss->cancel_attach(ss, cgrp, &tset);
> }
> }
> return retval;
> @@ -2005,6 +2083,7 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> struct task_struct *tsk;
> struct task_and_cgroup *tc;
> struct flex_array *group;
> + struct cgroup_taskset tset = { };
> /*
> * we need to make sure we have css_sets for all the tasks we're
> * going to move -before- we actually start moving them, so that in
> @@ -2067,6 +2146,8 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> } while_each_thread(leader, tsk);
> /* remember the number of threads in the array for later. */
> group_size = i;
> + tset.tc_array = group;
> + tset.tc_array_len = group_size;
> rcu_read_unlock();
>
> /* methods shouldn't be called if no task is actually migrating */
> @@ -2079,7 +2160,7 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> */
> for_each_subsys(root, ss) {
> if (ss->can_attach) {
> - retval = ss->can_attach(ss, cgrp, leader);
> + retval = ss->can_attach(ss, cgrp, &tset);
> if (retval) {
> failed_ss = ss;
> goto out_cancel_attach;
> @@ -2169,10 +2250,8 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader)
> * being moved, this call will need to be reworked to communicate that.
> */
> for_each_subsys(root, ss) {
> - if (ss->attach) {
> - tc = flex_array_get(group, 0);
> - ss->attach(ss, cgrp, tc->cgrp, tc->task);
> - }
> + if (ss->attach)
> + ss->attach(ss, cgrp, &tset);
> }
>
> /*
> @@ -2194,11 +2273,11 @@ out_cancel_attach:
> for_each_subsys(root, ss) {
> if (ss == failed_ss) {
> if (cancel_failed_ss && ss->cancel_attach)
> - ss->cancel_attach(ss, cgrp, leader);
> + ss->cancel_attach(ss, cgrp, &tset);
> break;
> }
> if (ss->cancel_attach)
> - ss->cancel_attach(ss, cgrp, leader);
> + ss->cancel_attach(ss, cgrp, &tset);
> }
> }
> out_put_tasks:
> diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
> index 4e82525..a2b0082 100644
> --- a/kernel/cgroup_freezer.c
> +++ b/kernel/cgroup_freezer.c
> @@ -159,7 +159,7 @@ static void freezer_destroy(struct cgroup_subsys *ss,
> */
> static int freezer_can_attach(struct cgroup_subsys *ss,
> struct cgroup *new_cgroup,
> - struct task_struct *task)
> + struct cgroup_taskset *tset)
> {
> struct freezer *freezer;
>
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 10131fd..2e5825b 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -1368,10 +1368,10 @@ static int fmeter_getrate(struct fmeter *fmp)
> }
>
> /* Called by cgroups to determine if a cpuset is usable; cgroup_mutex held */
> -static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cont,
> - struct task_struct *tsk)
> +static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
> + struct cgroup_taskset *tset)
> {
> - struct cpuset *cs = cgroup_cs(cont);
> + struct cpuset *cs = cgroup_cs(cgrp);
>
> if (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed))
> return -ENOSPC;
> @@ -1384,7 +1384,7 @@ static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cont,
> * set_cpus_allowed_ptr() on all attached tasks before cpus_allowed may
> * be changed.
> */
> - if (tsk->flags & PF_THREAD_BOUND)
> + if (cgroup_taskset_first(tset)->flags & PF_THREAD_BOUND)
> return -EINVAL;
>
> return 0;
> @@ -1434,12 +1434,14 @@ static void cpuset_attach_task(struct cgroup *cont, struct task_struct *tsk)
> cpuset_update_task_spread_flag(cs, tsk);
> }
>
> -static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,
> - struct cgroup *oldcont, struct task_struct *tsk)
> +static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
> + struct cgroup_taskset *tset)
> {
> struct mm_struct *mm;
> - struct cpuset *cs = cgroup_cs(cont);
> - struct cpuset *oldcs = cgroup_cs(oldcont);
> + struct task_struct *tsk = cgroup_taskset_first(tset);
> + struct cgroup *oldcgrp = cgroup_taskset_cur_cgroup(tset);
> + struct cpuset *cs = cgroup_cs(cgrp);
> + struct cpuset *oldcs = cgroup_cs(oldcgrp);
>
> /*
> * Change mm, possibly for multiple threads in a threadgroup. This is
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 930de94..b2802cc 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -5460,8 +5460,9 @@ static void mem_cgroup_clear_mc(void)
>
> static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
> struct cgroup *cgroup,
> - struct task_struct *p)
> + struct cgroup_taskset *tset)
> {
> + struct task_struct *p = cgroup_taskset_first(tset);
> int ret = 0;
> struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
>
Ah..hmm. I think this doesn't work as expected for memcg.
Maybe code like this will be required.
{
struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
struct mem_cgroup *from = NULL;
struct task_struct *p;
int ret = 0;
/*
* memcg just works against mm-owner. Check mm-owner is in this cgroup.
* Because tset contains only one thread-group, we'll find a task of
* mm->owner, at most.
*/
for_cgroup_taskset_for_each(task, NULL, tset) {
struct mm_struct *mm;
mm = get_task_mm(task);
if (!mm)
continue;
if (mm->owner == task) {
p = task;
break;
}
mmput(mm);
}
if (!p)
return ret;
from = mem_cgroup_from_task(p);
mem_cgroup_start_move(from);
spin_lock(&mc.lock);
mc.from = from;
mc.to = mem;
spin_unlock(&mc.lock);
/* We set mc.moving_task later */
ret = mem_cgroup_precharge_mc(mm);
if (ret)
mem_cgroup_clear_mc();
mm_put(mm);
return ret;
}
> @@ -5499,7 +5500,7 @@ static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
>
> static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
> struct cgroup *cgroup,
> - struct task_struct *p)
> + struct cgroup_taskset *tset)
> {
> mem_cgroup_clear_mc();
> }
> @@ -5616,9 +5617,9 @@ retry:
>
> static void mem_cgroup_move_task(struct cgroup_subsys *ss,
> struct cgroup *cont,
> - struct cgroup *old_cont,
> - struct task_struct *p)
> + struct cgroup_taskset *tset)
> {
> + struct task_struct *p = cgroup_taskset_first(tset);
> struct mm_struct *mm = get_task_mm(p);
>
Similar code with can_attach() will be required.
Thanks,
-Kame
^ permalink raw reply
* [PATCH] fuse: Freeze client on suspend when request sent to userspace
From: Todd Poynor @ 2011-08-24 23:59 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: fuse-devel, Linux PM mailing list
Suspend attempts can abort when the FUSE daemon is already frozen
and a client is waiting uninterruptibly for a response, causing
freezing of tasks to fail.
Use the freeze-friendly wait API, but disregard other signals.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
Have seen reports in which repeated suspend attempts were aborted
due to a task waiting uninterruptibly in this function, but
have only reproduced this artificially, by causing the daemon to
sleep. Only modified the normal request path, not request aborts
and such, under the assumption that these should be rare and
should make progress upon resume. Certain apps that read or
write a lot of data on the filesystem may apparently run into
this case rather frequently.
fs/fuse/dev.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 168a80f..bded2e5 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -19,6 +19,7 @@
#include <linux/pipe_fs_i.h>
#include <linux/swap.h>
#include <linux/splice.h>
+#include <linux/freezer.h>
MODULE_ALIAS_MISCDEV(FUSE_MINOR);
MODULE_ALIAS("devname:fuse");
@@ -383,7 +384,10 @@ __acquires(fc->lock)
* Wait it out.
*/
spin_unlock(&fc->lock);
- wait_event(req->waitq, req->state == FUSE_REQ_FINISHED);
+
+ while (req->state != FUSE_REQ_FINISHED)
+ wait_event_freezable(req->waitq,
+ req->state == FUSE_REQ_FINISHED);
spin_lock(&fc->lock);
if (!req->aborted)
--
1.7.3.1
^ permalink raw reply related
* Re: [PATCH] PM / Runtime: Correct documentation of pm_runtime_irq_safe()
From: Kevin Hilman @ 2011-08-24 23:45 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux PM mailing list, LKML
In-Reply-To: <201108242246.41574.rjw@sisk.pl>
"Rafael J. Wysocki" <rjw@sisk.pl> writes:
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> The description of pm_runtime_irq_safe() has to be updated to follow
> the code after commit 02b2677 (PM / Runtime: Allow _put_sync() from
> interrupts-disabled context).
oops, missed updating that part of the doc.
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Kevin Hilman <khilman@ti.com>
^ permalink raw reply
* [PATCH 1/1] OMAP: omap_device: only override _noirq methods, not normal suspend/resume
From: Kevin Hilman @ 2011-08-24 23:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Santosh Shilimkar
Cc: linux-pm, linux-omap, linux-arm-kernel
In-Reply-To: <1314229437-31836-1-git-send-email-khilman@ti.com>
commit c03f007a8bf0e092caeb6856a5c8a850df10b974 (OMAP: PM:
omap_device: add system PM methods for PM domain handling) mistakenly
used SET_SYSTEM_SLEEP_PM_OPS() when trying to configure custom methods
for the PM domains noirq methods. Fix that by setting only the
suspend_noirq and resume_noirq methods with custom versions.
Note that all other PM domain methods (including the "normal"
suspend/resume methods) are populated using USE_PLATFORM_PM_SLEEP_OPS,
which configures them all to the default subsystem (platform_bus)
methods.
Reported-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
arch/arm/plat-omap/omap_device.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index b6b4097..9a6a538 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -622,7 +622,8 @@ static struct dev_pm_domain omap_device_pm_domain = {
SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume,
_od_runtime_idle)
USE_PLATFORM_PM_SLEEP_OPS
- SET_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq, _od_resume_noirq)
+ .suspend_noirq = _od_suspend_noirq,
+ .resume_noirq = _od_resume_noirq,
}
};
--
1.7.6
^ permalink raw reply related
* [PATCH 0/1] PM: omap_device fix for v3.1-rc
From: Kevin Hilman @ 2011-08-24 23:43 UTC (permalink / raw)
To: Rafael J. Wysocki, Santosh Shilimkar
Cc: linux-pm, linux-omap, linux-arm-kernel
While this fix could go via the OMAP tree, since the original patch
causing the problem went via Rafael's tree (due to dependencies) I'm
submitting the fix to go via Rafael's tree as well.
Applies on v3.1-rc3.
Kevin Hilman (1):
OMAP: omap_device: only override _noirq methods, not normal
suspend/resume
arch/arm/plat-omap/omap_device.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
--
1.7.6
^ permalink raw reply
* Re: [POWER DOMAIN suspend callbacks] Observation.
From: Kevin Hilman @ 2011-08-24 23:38 UTC (permalink / raw)
To: Santosh; +Cc: Govindraj R, Linux PM mailing list, linux-omap
In-Reply-To: <4E549769.2030800@ti.com>
Santosh <santosh.shilimkar@ti.com> writes:
> On Tuesday 23 August 2011 10:36 PM, Kevin Hilman wrote:
>> Hi Santosh,
>>
>> Santosh<santosh.shilimkar@ti.com> writes:
>>
>>> Rafael, Kevin,
>>>
>>> On latest kernel( V3.1-rc1+), the subsystem(driver) suspend
>>> callbacks are not getting called because power domain callbcaks
>>> are populated.
>>>
>>> And as per commit 4d27e9dc{PM: Make power domain callbacks take
>>> precedence over subsystem ones}, it's expected bahavior.
>>
>> Correct.
>>
>>> Who is suppose to call the driver suspend callback?
>>
>> If populated, the PM domain callbacks should call the driver callbacks.
>> If there are no PM domain callbacks, then the subsystem (in this case,
>> the platform_bus) should be calling the driver callbacks.
>>
>>> Some drivers/subsystem would have state machine which needs to
>>> be suspended.
>>>
>>> Is the power domain suspend callback, suppose to take care of
>>> it ? If yes, then that seems to be missing for OMAP.
>>
>> Yup, there's a bug. They're not missing, just misplaced. ;)
>>
>> When adding the noirq callbacks to ensure devices are idled late in
>> suspend by omap_device, I the patch commited mistakenly uses
>> SET_SYSTEM_SLEEP_PM_OPS(), which sets the "normal" suspend/resume
>> handlers and not the noirq handlers.
>>
>> Can you try the patch below? I only briefly tested it on omap3/n900 so
>> far.
>>
> The patch works like charm.
Thanks, I'll add a tested-by for you.
Kevin
^ permalink raw reply
* Re: [BUG] Soft-lockup during cpu-hotplug in VFS callpaths
From: Andrew Morton @ 2011-08-24 23:02 UTC (permalink / raw)
To: Srivatsa S. Bhat; +Cc: linux-fsdevel, linux-pm, linux-kernel, Nick Piggin
In-Reply-To: <4E550057.9070609@linux.vnet.ibm.com>
On Wed, 24 Aug 2011 19:14:55 +0530
"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> wrote:
> Hi,
>
> While running stressful cpu hotplug tests along with kernel compilation
> running in background, soft-lockups are detected on multiple CPUs.
> Sometimes this also leads to hard lockups and kernel panic.
> All the soft-lockups seem to occur at vfsmount_lock_local_cpu() or other VFS
> callpaths.
>
>
> [37108.410813] BUG: soft lockup - CPU#5 stuck for 22s! [cc1:29669]
> <snip>
> [37108.694781] Call Trace:
> [37108.697306] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
> [37108.704258] [<ffffffff81187cb5>] path_init+0x315/0x400
> [37108.709558] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
> [37108.715812] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
> [37108.721203] [<ffffffff81012129>] ? sched_clock+0x9/0x10
> [37108.726597] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
> [37108.732508] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
> [37108.738498] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
> [37108.743970] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
> [37108.749362] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
> [37108.754665] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
> [37108.760575] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
> [37108.765875] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
> [37108.771352] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
> [37108.777695] [<ffffffff81179720>] sys_open+0x20/0x30
> [37108.782741] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
>
> Kernel version: 3.0.1, 3.0.3
> Hardware: Dual socket quad-core hyper-threaded Intel x86 machine
> Scenario:
> (a) Stressful cpu hotplug tests + kernel compilation
>
> (b) IRQ balancing had been disabled and all the IRQs were made to be
> routed to CPU 0 (except the ones that couldn't be routed).
>
> (c) Lockdep was enabled during kernel configuration.
>
> Steps (b) and (c) were done to dig deeper into the issue. However the same
> issue was observed by just doing step (a).
>
> Definitely there seems to be a race condition occurring here, because this
> issue is hit after sometime, after starting the tests. And the time it
> takes to hit the issue increases as we increase the number of debug print
> statements. In some cases (especially when the number of debug print
> statements were quite high), the stress on the machine had to be increased
> in order to hit the issue within measurable time. In my tests, a maximum
> of about 2 to 2.5 hours was sufficient, to hit this bug.
>
> Please find the console log attached with this mail.
>
> Any ideas on how to go about fixing this bug?
It's probably a bug in the core brlock implementation. I don't know
who would work on fixing that.
^ permalink raw reply
* Re: [PATCH 2/2 v2] sh-sci / PM: Use power.irq_safe
From: Rafael J. Wysocki @ 2011-08-24 20:52 UTC (permalink / raw)
To: Paul Mundt; +Cc: Linux PM mailing list, LKML, linux-sh
In-Reply-To: <20110824053317.GC26391@linux-sh.org>
On Wednesday, August 24, 2011, Paul Mundt wrote:
> On Sun, Aug 21, 2011 at 09:11:44PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > Since sci_port_enable() and sci_port_disable() may be run with
> > interrupts off and they execute pm_runtime_get_sync() and
> > pm_runtime_put_sync(), respectively, the SCI device's
> > power.irq_safe flags has to be used to indicate that it is safe
> > to execute runtime PM callbacks for this device with interrupts off.
> >
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> Not sure how you want this one handled. Did you simply want to roll this
> in with your other patch with my Acked-by, or should I be taking this
> through my tree already regardless of the 1/2 patch?
I'd prefer to push it through my tree, if you don't mind. Magnus has
already acked it for me, hopefully that's OK?
Rafael
^ permalink raw reply
* [PATCH] PM / Runtime: Correct documentation of pm_runtime_irq_safe()
From: Rafael J. Wysocki @ 2011-08-24 20:46 UTC (permalink / raw)
To: Linux PM mailing list; +Cc: LKML
From: Rafael J. Wysocki <rjw@sisk.pl>
The description of pm_runtime_irq_safe() has to be updated to follow
the code after commit 02b2677 (PM / Runtime: Allow _put_sync() from
interrupts-disabled context).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
Documentation/power/runtime_pm.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux/Documentation/power/runtime_pm.txt
===================================================================
--- linux.orig/Documentation/power/runtime_pm.txt
+++ linux/Documentation/power/runtime_pm.txt
@@ -431,8 +431,7 @@ drivers/base/power/runtime.c and include
void pm_runtime_irq_safe(struct device *dev);
- set the power.irq_safe flag for the device, causing the runtime-PM
- suspend and resume callbacks (but not the idle callback) to be invoked
- with interrupts disabled
+ callbacks to be invoked with interrupts off
void pm_runtime_mark_last_busy(struct device *dev);
- set the power.last_busy field to the current time
^ permalink raw reply
* [PATCH v2] Add regulator driver for the bq2407x family of charger ICs.
From: Heiko Stübner @ 2011-08-24 18:48 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-pm, Liam Girdwood
In-Reply-To: <20110824090746.GP9232@opensource.wolfsonmicro.com>
This driver controls a TI bq2407x charger attached via GPIOs.
The provided current regulator can enable/disable charging and
select between 100 mA, 500 mA and a machine specific current limit.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
Changes since v1:
- add private struct to keep track of gpio states
- get max_uA from regulator_init_data
(no need to define it twice)
- disallow setting current limix below 100mA
drivers/regulator/Kconfig | 8 +
drivers/regulator/Makefile | 1 +
drivers/regulator/bq2407x.c | 264 +++++++++++++++++++++++++++++++++++++
include/linux/regulator/bq2407x.h | 35 +++++
4 files changed, 308 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index c7fd2c0..921e271 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -72,6 +72,14 @@ config REGULATOR_BQ24022
charging select between 100 mA and 500 mA charging current
limit.
+config REGULATOR_BQ2407x
+ tristate "TI bq2407x Li-Ion Charger IC"
+ help
+ This driver controls a TI bq2407x Charger attached via
+ GPIOs. The provided current regulator can enable/disable
+ charging select between 100 mA, 500 mA and a machine specific
+ charging current limit.
+
config REGULATOR_MAX1586
tristate "Maxim 1586/1587 voltage regulator"
depends on I2C
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 040d5aa..ce65493 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
+obj-$(CONFIG_REGULATOR_BQ2407x) += bq2407x.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
diff --git a/drivers/regulator/bq2407x.c b/drivers/regulator/bq2407x.c
new file mode 100644
index 0000000..a8221d5
--- /dev/null
+++ b/drivers/regulator/bq2407x.c
@@ -0,0 +1,264 @@
+/*
+ * Support for TI bq2407x USB-friendly
+ * Li-Ion Charger connected via GPIOs.
+ *
+ * Copyright (c) 2011 Heiko Stuebner
+ *
+ * based on the bq24022 driver
+ * Copyright (c) 2008 Philipp Zabel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/gpio.h>
+#include <linux/regulator/bq2407x.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+
+struct bq2407x {
+ struct regulator_dev *rdev;
+
+ int gpio_nce;
+ int gpio_en2;
+ int gpio_en1;
+
+ int state_nce;
+ int state_en2;
+ int state_en1;
+
+ int max_uA;
+};
+
+
+static int bq2407x_set_current_limit(struct regulator_dev *rdev,
+ int min_uA, int max_uA)
+{
+ struct bq2407x *bq = rdev_get_drvdata(rdev);
+
+ if (bq->max_uA && bq->max_uA > 500000
+ && max_uA >= bq->max_uA) {
+ dev_dbg(rdev_get_dev(rdev),
+ "setting current limit to %d mA\n",
+ bq->max_uA / 1000);
+ gpio_set_value(bq->gpio_en2, 1);
+ bq->state_en2 = 1;
+ gpio_set_value(bq->gpio_en1, 0);
+ bq->state_en1 = 0;
+ } else if (max_uA >= 500000) {
+ dev_dbg(rdev_get_dev(rdev),
+ "setting current limit to 500 mA\n");
+ gpio_set_value(bq->gpio_en2, 0);
+ bq->state_en2 = 0;
+ gpio_set_value(bq->gpio_en1, 1);
+ bq->state_en1 = 1;
+ } else if (max_uA >= 100000) {
+ dev_dbg(rdev_get_dev(rdev),
+ "setting current limit to 100 mA\n");
+ gpio_set_value(bq->gpio_en2, 0);
+ bq->state_en2 = 0;
+ gpio_set_value(bq->gpio_en1, 0);
+ bq->state_en1 = 0;
+ } else {
+ dev_err(rdev_get_dev(rdev), "cannot set current limit below 100 mA\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int bq2407x_get_current_limit(struct regulator_dev *rdev)
+{
+ struct bq2407x *bq = rdev_get_drvdata(rdev);
+
+ if (bq->state_en2 && bq->state_en1)
+ return 0;
+ else if (bq->state_en2 && !bq->state_en1)
+ return bq->max_uA;
+ else if (!bq->state_en2 && bq->state_en1)
+ return 500000;
+ else
+ return 100000;
+}
+
+static int bq2407x_enable(struct regulator_dev *rdev)
+{
+ struct bq2407x *bq = rdev_get_drvdata(rdev);
+
+ dev_dbg(rdev_get_dev(rdev), "enabling charger\n");
+
+ gpio_set_value(bq->gpio_nce, 0);
+ bq->state_nce = 0;
+
+ return 0;
+}
+
+static int bq2407x_disable(struct regulator_dev *rdev)
+{
+ struct bq2407x *bq = rdev_get_drvdata(rdev);
+
+ dev_dbg(rdev_get_dev(rdev), "disabling charger\n");
+
+ gpio_set_value(bq->gpio_nce, 1);
+ bq->state_nce = 1;
+
+ return 0;
+}
+
+static int bq2407x_is_enabled(struct regulator_dev *rdev)
+{
+ struct bq2407x *bq = rdev_get_drvdata(rdev);
+
+ return !bq->state_nce;
+}
+
+static struct regulator_ops bq2407x_ops = {
+ .set_current_limit = bq2407x_set_current_limit,
+ .get_current_limit = bq2407x_get_current_limit,
+ .enable = bq2407x_enable,
+ .disable = bq2407x_disable,
+ .is_enabled = bq2407x_is_enabled,
+};
+
+static struct regulator_desc bq2407x_desc = {
+ .name = "bq2407x",
+ .ops = &bq2407x_ops,
+ .type = REGULATOR_CURRENT,
+ .owner = THIS_MODULE,
+};
+
+static int __init bq2407x_probe(struct platform_device *pdev)
+{
+ struct bq2407x_mach_info *pdata = pdev->dev.platform_data;
+ struct bq2407x *bq;
+ int ret;
+
+ if (!pdata || !pdata->gpio_nce || !pdata->gpio_en1 || !pdata->gpio_en2)
+ return -EINVAL;
+
+ bq = kzalloc(sizeof(struct bq2407x), GFP_KERNEL);
+ if (!bq) {
+ dev_err(&pdev->dev, "cannot allocate memory\n");
+ return -ENOMEM;
+ }
+
+ ret = gpio_request(pdata->gpio_nce, "ncharge_en");
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't request nCE GPIO: %d\n",
+ pdata->gpio_nce);
+ goto err_ce;
+ }
+ ret = gpio_request(pdata->gpio_en2, "charge_mode_en2");
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't request EN2 GPIO: %d\n",
+ pdata->gpio_en2);
+ goto err_en2;
+ }
+ ret = gpio_request(pdata->gpio_en1, "charge_mode_en1");
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't request EN1 GPIO: %d\n",
+ pdata->gpio_en1);
+ goto err_en1;
+ }
+
+ /* set initial current to 100mA and disable regulator */
+ ret = gpio_direction_output(pdata->gpio_en2, 0);
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't set EN2 GPIO: %d\n",
+ pdata->gpio_en1);
+ goto err_reg;
+ }
+ bq->gpio_en2 = pdata->gpio_en2;
+ bq->state_en2 = 0;
+ ret = gpio_direction_output(pdata->gpio_en1, 0);
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't set EN1 GPIO: %d\n",
+ pdata->gpio_en1);
+ goto err_reg;
+ }
+ bq->gpio_en1 = pdata->gpio_en1;
+ bq->state_en1 = 0;
+ ret = gpio_direction_output(pdata->gpio_nce, 1);
+ if (ret) {
+ dev_dbg(&pdev->dev, "couldn't set nCE GPIO: %d\n",
+ pdata->gpio_en1);
+ goto err_reg;
+ }
+ bq->gpio_nce = pdata->gpio_nce;
+ bq->state_nce = 1;
+
+ /* get maximum current from regulator_init_data */
+ if (pdata->init_data) {
+ bq->max_uA = pdata->init_data->constraints.max_uA;
+ dev_dbg(&pdev->dev, "maximum current is %d mA\n",
+ bq->max_uA / 1000);
+ }
+
+ bq->rdev = regulator_register(&bq2407x_desc, &pdev->dev,
+ pdata->init_data, bq);
+ if (IS_ERR(bq->rdev)) {
+ dev_dbg(&pdev->dev, "couldn't register regulator\n");
+ ret = PTR_ERR(bq->rdev);
+ goto err_reg;
+ }
+
+ platform_set_drvdata(pdev, bq);
+ dev_dbg(&pdev->dev, "registered regulator\n");
+
+ return 0;
+err_reg:
+ gpio_free(pdata->gpio_en1);
+err_en1:
+ gpio_free(pdata->gpio_en2);
+err_en2:
+ gpio_free(pdata->gpio_nce);
+err_ce:
+ kfree(bq);
+ return ret;
+}
+
+static int __devexit bq2407x_remove(struct platform_device *pdev)
+{
+ struct bq2407x *bq = platform_get_drvdata(pdev);
+
+ regulator_unregister(bq->rdev);
+ gpio_free(bq->gpio_en1);
+ gpio_free(bq->gpio_en2);
+ gpio_free(bq->gpio_nce);
+
+ kfree(bq);
+
+ return 0;
+}
+
+static struct platform_driver bq2407x_driver = {
+ .driver = {
+ .name = "bq2407x",
+ },
+ .remove = __devexit_p(bq2407x_remove),
+};
+
+static int __init bq2407x_init(void)
+{
+ return platform_driver_probe(&bq2407x_driver, bq2407x_probe);
+}
+
+static void __exit bq2407x_exit(void)
+{
+ platform_driver_unregister(&bq2407x_driver);
+}
+
+module_init(bq2407x_init);
+module_exit(bq2407x_exit);
+
+MODULE_AUTHOR("Heiko Stuebner");
+MODULE_DESCRIPTION("TI bq2407x Li-Ion Charger driver");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/regulator/bq2407x.h b/include/linux/regulator/bq2407x.h
new file mode 100644
index 0000000..14d6d93
--- /dev/null
+++ b/include/linux/regulator/bq2407x.h
@@ -0,0 +1,35 @@
+/*
+ * Support for TI bq2407x 1.5A USB-friendly
+ * Li-Ion Charger connected via GPIOs.
+ *
+ * Copyright (c) 2011 Heiko Stuebner
+ *
+ * based on the bq24022 driver
+ * Copyright (c) 2008 Philipp Zabel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+struct regulator_init_data;
+
+/**
+ * bq2407x_mach_info - platform data for bq2407x
+ * @gpio_nce: GPIO line connected to the nCE pin, used to control charging
+ * @gpio_en2: GPIO line connected to the EN2 pin, used to limit charging
+ * @gpio_en1: GPIO line connected to the EN1 pin, used to limit charging
+ * @max_uA: maximum current defined by resistor on ILIM connector
+ * Modes of operation:
+ * EN2 = 0, EN1 = 0: 100mA
+ * EN2 = 0, EN1 = 1: 500mA
+ * EN2 = 1, EN1 = 0: max_current
+ * EN2 = 1, EN1 = 1: Standby (usb suspend)
+ */
+struct bq2407x_mach_info {
+ int gpio_nce;
+ int gpio_en2;
+ int gpio_en1;
+ struct regulator_init_data *init_data;
+};
--
tg: (93ee7a9..) topic/drivers/bq2407x (depends on: master)
^ permalink raw reply related
* Re: [PATCHSET] cgroup: introduce cgroup_taskset and consolidate subsys methods
From: Frederic Weisbecker @ 2011-08-24 13:53 UTC (permalink / raw)
To: Tejun Heo; +Cc: containers, lizf, linux-kernel, linux-pm, paul
In-Reply-To: <20110824074959.GA14170@htj.dyndns.org>
On Wed, Aug 24, 2011 at 09:49:59AM +0200, Tejun Heo wrote:
> Hello, Frederic.
>
> On Wed, Aug 24, 2011 at 03:14:30AM +0200, Frederic Weisbecker wrote:
> > > 0001-cgroup-subsys-attach_task-should-be-called-after-mig.patch
> > > 0002-cgroup-improve-old-cgroup-handling-in-cgroup_attach_.patch
> > > 0003-cgroup-introduce-cgroup_taskset-and-use-it-in-subsys.patch
> > > 0004-cgroup-don-t-use-subsys-can_attach_task-or-attach_ta.patch
> > > 0005-cgroup-cpuset-don-t-use-ss-pre_attach.patch
> > > 0006-cgroup-kill-subsys-can_attach_task-pre_attach-and-at.patch
> >
> > I don't understand the point on patches 3,4,5,6
> >
> > Why pushing the task iterations down to the subsystems?
>
> I'll try again.
>
> It seems like methods were added to serve the immediate need of the
> particular user at the time and that in turn led to addition of
> callbacks which were both superflous and incomplete (the bullet points
> in the original message list them). This seems to have happened
> because extra interface was added without trying to make the existing
> interface complete.
>
> The interface is complicated and cumbersome to use - are
> [can_]attach() called first or [can_]attach_task()? What about
> cancelation? What if a subsys wants to perform operations across
> multiple tasks atomically?
>
> In general, iteration-by-callback is painful to use. Establishing
> common context (be it synchronization domain or shared variables)
> becomes very cumbersome and implementation becomes fragmented and
> difficult to follow. For example, imagine how it would be like to use
> list if we had call_for_each_list_entry(func, list_head) instead of
> the control-loop style iterators we have know.
>
> So, using iterators enables making all relevant information to each
> stage of attach so that only one callback is required for each step -
> the way it should be. In addition, it makes it far easier for
> subsystems to implement more involved logic in their methods.
>
> I tried to make cgroup_freezer behave better which requires better
> synchronization against the freezer and, with the current interface,
> it's extremely ugly and painful. The new interface is complete, easy
> to understand and use with far less subtleties.
Yeah it's true that the order between [can]attach/[can]attach_task plus
the added mess with pre_attach was not entirely sane. The fact we have
foo and foo_task is already a problem.
I guess we indeed need to sacrifice the iteration from the cgroup core
for that.
^ permalink raw reply
* [BUG] Soft-lockup during cpu-hotplug in VFS callpaths
From: Srivatsa S. Bhat @ 2011-08-24 13:44 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-fsdevel, linux-pm
[-- Attachment #1: Type: text/plain, Size: 2606 bytes --]
Hi,
While running stressful cpu hotplug tests along with kernel compilation
running in background, soft-lockups are detected on multiple CPUs.
Sometimes this also leads to hard lockups and kernel panic.
All the soft-lockups seem to occur at vfsmount_lock_local_cpu() or other VFS
callpaths.
[37108.410813] BUG: soft lockup - CPU#5 stuck for 22s! [cc1:29669]
<snip>
[37108.694781] Call Trace:
[37108.697306] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37108.704258] [<ffffffff81187cb5>] path_init+0x315/0x400
[37108.709558] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37108.715812] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37108.721203] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37108.726597] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37108.732508] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37108.738498] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37108.743970] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37108.749362] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.754665] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37108.760575] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.765875] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37108.771352] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37108.777695] [<ffffffff81179720>] sys_open+0x20/0x30
[37108.782741] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
Kernel version: 3.0.1, 3.0.3
Hardware: Dual socket quad-core hyper-threaded Intel x86 machine
Scenario:
(a) Stressful cpu hotplug tests + kernel compilation
(b) IRQ balancing had been disabled and all the IRQs were made to be
routed to CPU 0 (except the ones that couldn't be routed).
(c) Lockdep was enabled during kernel configuration.
Steps (b) and (c) were done to dig deeper into the issue. However the same
issue was observed by just doing step (a).
Definitely there seems to be a race condition occurring here, because this
issue is hit after sometime, after starting the tests. And the time it
takes to hit the issue increases as we increase the number of debug print
statements. In some cases (especially when the number of debug print
statements were quite high), the stress on the machine had to be increased
in order to hit the issue within measurable time. In my tests, a maximum
of about 2 to 2.5 hours was sufficient, to hit this bug.
Please find the console log attached with this mail.
Any ideas on how to go about fixing this bug?
--
Regards,
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Linux Technology Center,
IBM India Systems and Technology Lab
[-- Attachment #2: soft-lockup_log.txt --]
[-- Type: text/plain, Size: 58724 bytes --]
[37108.410813] BUG: soft lockup - CPU#5 stuck for 22s! [cc1:29669]
[37108.416815] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37108.469864] irq event stamp: 240636
[37108.473431] hardirqs last enabled at (240635): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37108.481869] hardirqs last disabled at (240636): [<ffffffff8152596a>] save_args+0x6a/0x70
[37108.490132] softirqs last enabled at (240634): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37108.498833] softirqs last disabled at (240629): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37108.507355] CPU 5
[37108.509201] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37108.562468]
[37108.564042] Pid: 29669, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37108.573478] RIP: 0010:[<ffffffff81199ec2>] [<ffffffff81199ec2>] vfsmount_lock_local_lock+0x52/0x60
[37108.582692] RSP: 0018:ffff88033c34fd28 EFLAGS: 00000297
[37108.588080] RAX: ffff88047e9d0340 RBX: ffffffff81525ad4 RCX: 0000000000002387
[37108.595287] RDX: 0000000000002388 RSI: 1208000000000000 RDI: 0000000000000246
[37108.602494] RBP: ffff88033c34fd38 R08: 0000000000000241 R09: fffffffff6fc0241
[37108.609701] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37108.616907] R13: ffff88047e800000 R14: ffff88033c34e000 R15: 0000000000000000
[37108.624115] FS: 00007f4c41bd3700(0000) GS:ffff88047e800000(0000) knlGS:0000000000000000
[37108.632359] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37108.638175] CR2: 00007f4c3af2f000 CR3: 0000000316e20000 CR4: 00000000000006e0
[37108.645383] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37108.652592] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37108.659801] Process cc1 (pid: 29669, threadinfo ffff88033c34e000, task ffff8803b3b22840)
[37108.668036] Stack:
[37108.671879] ffffffff81199e70 ffffffff829cbf7a ffff88033c34fd98 ffffffff81187cb5
[37108.679513] ffff88033c34fd78 ffffffff8127c398 ffff88046dea1980 ffff88046dea1980
[37108.687147] ffff88046f7f4ec0 ffff8802eda17000 ffff88033c34fd98 ffff88033c34fe38
[37108.694781] Call Trace:
[37108.697306] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37108.704258] [<ffffffff81187cb5>] path_init+0x315/0x400
[37108.709558] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37108.715812] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37108.721203] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37108.726597] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37108.732508] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37108.738498] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37108.743970] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37108.749362] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.754665] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37108.760575] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.765875] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37108.771352] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37108.777695] [<ffffffff81179720>] sys_open+0x20/0x30
[37108.782741] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37108.788824] Code: c7 04 24 70 9e 19 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10
[37108.802938] d1 74 07 f3 90 0f b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53
[37108.810555] Call Trace:
[37108.813080] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37108.820031] [<ffffffff81187cb5>] path_init+0x315/0x400
[37108.825332] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37108.831587] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37108.836972] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37108.842362] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37108.848278] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37108.854272] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37108.859750] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37108.865140] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.870443] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37108.876354] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37108.881661] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37108.887134] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37108.893474] [<ffffffff81179720>] sys_open+0x20/0x30
[37108.898514] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.145765] BUG: soft lockup - CPU#1 stuck for 22s! [cc1:29657]
[37109.151765] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.204848] irq event stamp: 307814
[37109.208415] hardirqs last enabled at (307813): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37109.216856] hardirqs last disabled at (307814): [<ffffffff8152596a>] save_args+0x6a/0x70
[37109.225122] softirqs last enabled at (307812): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37109.230211] BUG: soft lockup - CPU#2 stuck for 22s! [objdump:29880]
[37109.230214] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.230250] irq event stamp: 239336
[37109.230251] hardirqs last enabled at (239335): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37109.230257] hardirqs last disabled at (239336): [<ffffffff8152596a>] save_args+0x6a/0x70
[37109.230260] softirqs last enabled at (239334): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37109.230265] softirqs last disabled at (239329): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37109.230270] CPU 2
[37109.230271] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.230305]
[37109.230308] Pid: 29880, comm: objdump Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37109.230312] RIP: 0010:[<ffffffff8119a3b1>] [<ffffffff8119a3b1>] vfsmount_lock_global_lock_online+0x71/0xa0
[37109.230319] RSP: 0018:ffff88017b0f5d38 EFLAGS: 00000202
[37109.230322] RAX: 000000000000000b RBX: ffffffff81525ad4 RCX: 000000000000fdf5
[37109.230324] RDX: 000000000000fdf6 RSI: ffff8801f95d0340 RDI: 0000000000000018
[37109.230327] RBP: ffff88017b0f5d68 R08: ffffffff81c1fa40 R09: 0000000000000000
[37109.230329] R10: 00000000000270d0 R11: 0000000000000001 R12: ffffffff8152ec6e
[37109.230332] R13: ffff8801f8a00000 R14: ffff88017b0f4000 R15: 0000000000000000
[37109.230335] FS: 0000000000000000(0000) GS:ffff8801f8a00000(0000) knlGS:0000000000000000
[37109.230338] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37109.230340] CR2: 000000390baabd60 CR3: 0000000001a03000 CR4: 00000000000006e0
[37109.230343] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37109.230345] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37109.230348] Process objdump (pid: 29880, threadinfo ffff88017b0f4000, task ffff8801f1ed86c0)
[37109.230351] Stack:
[37109.230352] ffffffff8119a85f ffff88010f05da00 ffff8801579d3280 ffff88046f578580
[37109.230357] ffff88046f5785b8 ffff88010f05da00 ffff88017b0f5d98 ffffffff8119a85f
[37109.230362] ffff880116443080 0000000000000008 ffff88010f05da00 ffff8801579d3280
[37109.230367] Call Trace:
[37109.230372] [<ffffffff8119a85f>] ? mntput_no_expire+0x5f/0x140
[37109.230376] [<ffffffff8119a85f>] mntput_no_expire+0x5f/0x140
[37109.230379] [<ffffffff8119a95d>] mntput+0x1d/0x30
[37109.230384] [<ffffffff8117bdff>] __fput+0x17f/0x250
[37109.230387] [<ffffffff8117bef5>] fput+0x25/0x30
[37109.230393] [<ffffffff81177cf6>] filp_close+0x66/0xa0
[37109.230398] [<ffffffff8106a5a8>] close_files+0xc8/0x180
[37109.230402] [<ffffffff8106a4e0>] ? find_new_reaper+0x100/0x100
[37109.230406] [<ffffffff8106a7da>] ? exit_files+0x4a/0x60
[37109.230410] [<ffffffff8106a695>] put_files_struct+0x35/0x130
[37109.230414] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.230418] [<ffffffff8106a7e2>] exit_files+0x52/0x60
[37109.230422] [<ffffffff8106c4ea>] do_exit+0x18a/0x490
[37109.230428] [<ffffffff810a619d>] ? trace_hardirqs_on_caller+0x13d/0x180
[37109.230432] [<ffffffff8106c84e>] do_group_exit+0x5e/0xd0
[37109.230436] [<ffffffff8106c8d7>] sys_exit_group+0x17/0x20
[37109.230440] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.230443] Code: ff 4c 8b 25 ba 41 47 00 eb 26 48 63 d0 48 89 de 44 89 e9 48 03 34 d5 c0 52 c1 81 f0 0f c1 0e 0f b7 d1 c1 e9 10 39 ca 74 07 f3 90 <0f> b7 16 eb f5 48 63 35 0b 6d a8 00 83 c0 01 4c 89 e7 48 63 d0
[37109.230471] Call Trace:
[37109.230475] [<ffffffff8119a85f>] ? mntput_no_expire+0x5f/0x140
[37109.230479] [<ffffffff8119a85f>] mntput_no_expire+0x5f/0x140
[37109.230483] [<ffffffff8119a95d>] mntput+0x1d/0x30
[37109.230486] [<ffffffff8117bdff>] __fput+0x17f/0x250
[37109.230490] [<ffffffff8117bef5>] fput+0x25/0x30
[37109.230493] [<ffffffff81177cf6>] filp_close+0x66/0xa0
[37109.230497] [<ffffffff8106a5a8>] close_files+0xc8/0x180
[37109.230501] [<ffffffff8106a4e0>] ? find_new_reaper+0x100/0x100
[37109.230505] [<ffffffff8106a7da>] ? exit_files+0x4a/0x60
[37109.230509] [<ffffffff8106a695>] put_files_struct+0x35/0x130
[37109.230513] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.230517] [<ffffffff8106a7e2>] exit_files+0x52/0x60
[37109.230520] [<ffffffff8106c4ea>] do_exit+0x18a/0x490
[37109.230524] [<ffffffff810a619d>] ? trace_hardirqs_on_caller+0x13d/0x180
[37109.230528] [<ffffffff8106c84e>] do_group_exit+0x5e/0xd0
[37109.230532] [<ffffffff8106c8d7>] sys_exit_group+0x17/0x20
[37109.230536] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.524020] BUG: soft lockup - CPU#0 stuck for 22s! [cc1:29501]
[37109.524022] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.524059] irq event stamp: 315444
[37109.524060] hardirqs last enabled at (315443): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37109.524065] hardirqs last disabled at (315444): [<ffffffff8152596a>] save_args+0x6a/0x70
[37109.524069] softirqs last enabled at (315442): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37109.524073] softirqs last disabled at (315437): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37109.524078] CPU 0
[37109.524079] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.524112]
[37109.524115] Pid: 29501, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37109.524119] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37109.524124] RSP: 0018:ffff88039b7f9d28 EFLAGS: 00000287
[37109.524126] RAX: ffff8801f87d0340 RBX: ffffffff81525ad4 RCX: 0000000000007edf
[37109.524129] RDX: 0000000000007ee0 RSI: 1208000000000000 RDI: 0000000000000246
[37109.524131] RBP: ffff88039b7f9d38 R08: 0000000000000241 R09: fffffffff6fc0241
[37109.524134] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37109.524136] R13: ffff8801f8600000 R14: ffff88039b7f8000 R15: 0000000000000000
[37109.524139] FS: 00007f464d9c1700(0000) GS:ffff8801f8600000(0000) knlGS:0000000000000000
[37109.524142] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37109.524144] CR2: 00007f464637f000 CR3: 000000046ccd2000 CR4: 00000000000006f0
[37109.524147] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37109.524149] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37109.524152] Process cc1 (pid: 29501, threadinfo ffff88039b7f8000, task ffff8804144ee8c0)
[37109.524154] Stack:
[37109.524155] ffffffff81199e70 ffffffff829cbf7a ffff88039b7f9d98 ffffffff81187cb5
[37109.524161] ffff88039b7f9d78 ffffffff8127c398 ffff8801141f0980 ffff8801141f0980
[37109.524166] ffff88046c6e9180 ffff880176b90000 ffff88039b7f9d98 ffff88039b7f9e38
[37109.524171] Call Trace:
[37109.524174] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37109.524178] [<ffffffff81187cb5>] path_init+0x315/0x400
[37109.524184] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37109.524188] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37109.524193] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37109.524198] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37109.524203] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37109.524206] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37109.524210] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37109.524213] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.524217] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.524221] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.524225] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37109.524230] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37109.524235] [<ffffffff81179720>] sys_open+0x20/0x30
[37109.524238] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.524240] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37109.524269] Call Trace:
[37109.524272] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37109.524276] [<ffffffff81187cb5>] path_init+0x315/0x400
[37109.524279] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37109.524283] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37109.524287] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37109.524290] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37109.524294] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37109.524297] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37109.524301] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37109.524304] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.524308] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.524311] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.524315] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37109.524319] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37109.524323] [<ffffffff81179720>] sys_open+0x20/0x30
[37109.524327] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.615999] BUG: soft lockup - CPU#8 stuck for 23s! [cc1:29811]
[37109.616001] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.616036] irq event stamp: 288768
[37109.616038] hardirqs last enabled at (288767): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37109.616042] hardirqs last disabled at (288768): [<ffffffff8152596a>] save_args+0x6a/0x70
[37109.616046] softirqs last enabled at (288766): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37109.616050] softirqs last disabled at (288761): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37109.616054] CPU 8
[37109.616055] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37109.616088]
[37109.616090] Pid: 29811, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37109.616094] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37109.616099] RSP: 0018:ffff88019148fd28 EFLAGS: 00000287
[37109.616101] RAX: ffff8801f8fd0340 RBX: ffffffff81525ad4 RCX: 000000000000707f
[37109.616104] RDX: 0000000000007080 RSI: 1208000000000000 RDI: 0000000000000246
[37109.616106] RBP: ffff88019148fd38 R08: 0000000000000241 R09: fffffffff6fc0241
[37109.616109] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37109.616111] R13: ffff8801f8e00000 R14: ffff88019148e000 R15: 0000000000000000
[37109.616114] FS: 00007fc65fa7b700(0000) GS:ffff8801f8e00000(0000) knlGS:0000000000000000
[37109.616117] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37109.616119] CR2: 00007fc659930000 CR3: 000000010b021000 CR4: 00000000000006e0
[37109.616122] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37109.616125] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37109.616127] Process cc1 (pid: 29811, threadinfo ffff88019148e000, task ffff880122d288c0)
[37109.616129] Stack:
[37109.616131] ffffffff81199e70 ffffffff829cbf7a ffff88019148fd98 ffffffff81187cb5
[37109.616136] ffff88019148fd78 ffffffff8127c398 ffff8801f47ca6c0 ffff8801f47ca6c0
[37109.616141] ffff880074776540 ffff8800738ae000 ffff88019148fd98 ffff88019148fe38
[37109.616146] Call Trace:
[37109.616149] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37109.616153] [<ffffffff81187cb5>] path_init+0x315/0x400
[37109.616157] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37109.616161] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37109.616164] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37109.616168] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37109.616172] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37109.616175] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37109.616179] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37109.616182] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.616186] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.616190] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.616194] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37109.616198] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37109.616202] [<ffffffff81179720>] sys_open+0x20/0x30
[37109.616206] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37109.616208] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37109.616236] Call Trace:
[37109.616239] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37109.616243] [<ffffffff81187cb5>] path_init+0x315/0x400
[37109.616247] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37109.616250] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37109.616254] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37109.616257] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37109.616261] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37109.616265] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37109.616268] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37109.616272] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.616275] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37109.616279] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37109.616283] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37109.616287] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37109.616291] [<ffffffff81179720>] sys_open+0x20/0x30
[37109.616294] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37110.125211] BUG: soft lockup - CPU#6 stuck for 22s! [fixdep:29868]
[37110.125212] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37110.125237] irq event stamp: 218696
[37110.125238] hardirqs last enabled at (218695): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37110.125242] hardirqs last disabled at (218696): [<ffffffff8152596a>] save_args+0x6a/0x70
[37110.125245] softirqs last enabled at (218694): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37110.125248] softirqs last disabled at (218679): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37110.125251] CPU 6
[37110.125252] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37110.125275]
[37110.125277] Pid: 29868, comm: fixdep Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37110.125280] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37110.125284] RSP: 0018:ffff88032e819e58 EFLAGS: 00000297
[37110.125286] RAX: ffff88047ebd0340 RBX: ffffffff81525ad4 RCX: 0000000000005aae
[37110.125287] RDX: 0000000000005aaf RSI: 1208000000000000 RDI: 0000000000000246
[37110.125289] RBP: ffff88032e819e68 R08: 0000000000000241 R09: fffffffff6fc0241
[37110.125291] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37110.125293] R13: ffff88047ea00000 R14: ffff88032e818000 R15: 0000000000000000
[37110.125295] FS: 00007f93a174a700(0000) GS:ffff88047ea00000(0000) knlGS:0000000000000000
[37110.125297] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37110.125298] CR2: 00007f93a1748004 CR3: 0000000366591000 CR4: 00000000000006e0
[37110.125300] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37110.125302] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37110.125304] Process fixdep (pid: 29868, threadinfo ffff88032e818000, task ffff88036364a400)
[37110.125305] Stack:
[37110.125306] ffffffff81199e70 ffff88017ad61ac0 ffff88032e819e98 ffffffff8119a82c
[37110.125310] ffff880433d07380 0000000000000010 ffff88015784a208 ffff88017ad61ac0
[37110.125313] ffff88032e819ea8 ffffffff8119a95d ffff88032e819ef8 ffffffff8117bdff
[37110.125317] Call Trace:
[37110.125319] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37110.125322] [<ffffffff8119a82c>] mntput_no_expire+0x2c/0x140
[37110.125325] [<ffffffff8119a95d>] mntput+0x1d/0x30
[37110.125328] [<ffffffff8117bdff>] __fput+0x17f/0x250
[37110.125331] [<ffffffff81179807>] ? sys_close+0xb7/0x1a0
[37110.125333] [<ffffffff8117bef5>] fput+0x25/0x30
[37110.125336] [<ffffffff81177cf6>] filp_close+0x66/0xa0
[37110.125339] [<ffffffff81179812>] sys_close+0xc2/0x1a0
[37110.125342] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37110.125343] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37110.125362] Call Trace:
[37110.125365] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37110.125368] [<ffffffff8119a82c>] mntput_no_expire+0x2c/0x140
[37110.125370] [<ffffffff8119a95d>] mntput+0x1d/0x30
[37110.125372] [<ffffffff8117bdff>] __fput+0x17f/0x250
[37110.125375] [<ffffffff81179807>] ? sys_close+0xb7/0x1a0
[37110.125377] [<ffffffff8117bef5>] fput+0x25/0x30
[37110.125380] [<ffffffff81177cf6>] filp_close+0x66/0xa0
[37110.125383] [<ffffffff81179812>] sys_close+0xc2/0x1a0
[37110.125385] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37110.823397] BUG: soft lockup - CPU#7 stuck for 23s! [cc1:29131]
[37110.823399] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37110.823424] irq event stamp: 327546
[37110.823426] hardirqs last enabled at (327545): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37110.823430] hardirqs last disabled at (327546): [<ffffffff8152596a>] save_args+0x6a/0x70
[37110.823433] softirqs last enabled at (327544): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37110.823436] softirqs last disabled at (327539): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37110.823439] CPU 7
[37110.823440] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37110.823463]
[37110.823465] Pid: 29131, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37110.823468] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37110.823472] RSP: 0018:ffff8802f24ffd28 EFLAGS: 00000297
[37110.823473] RAX: ffff88047edd0340 RBX: ffffffff81525ad4 RCX: 0000000000000c08
[37110.823475] RDX: 0000000000000c09 RSI: 1208000000000000 RDI: 0000000000000246
[37110.823477] RBP: ffff8802f24ffd38 R08: 0000000000000241 R09: fffffffff6fc0241
[37110.823479] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37110.823480] R13: ffff88047ec00000 R14: ffff8802f24fe000 R15: 0000000000000000
[37110.823483] FS: 00007fae99083700(0000) GS:ffff88047ec00000(0000) knlGS:0000000000000000
[37110.823485] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37110.823486] CR2: 00007fae90cbf000 CR3: 000000033c813000 CR4: 00000000000006e0
[37110.823488] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37110.823490] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37110.823492] Process cc1 (pid: 29131, threadinfo ffff8802f24fe000, task ffff880326bee3c0)
[37110.823493] Stack:
[37110.823494] ffffffff81199e70 ffffffff829cbf7a ffff8802f24ffd98 ffffffff81187cb5
[37110.823498] ffff8802f24ffd78 ffffffff8127c398 ffff88035689d6c0 ffff88035689d6c0
[37110.823501] ffff88046c73f380 ffff8803989c7000 ffff8802f24ffd98 ffff8802f24ffe38
[37110.823505] Call Trace:
[37110.823508] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37110.823510] [<ffffffff81187cb5>] path_init+0x315/0x400
[37110.823514] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37110.823516] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37110.823519] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37110.823522] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37110.823525] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37110.823527] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37110.823530] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37110.823532] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37110.823535] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37110.823537] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37110.823541] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37110.823544] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37110.823547] [<ffffffff81179720>] sys_open+0x20/0x30
[37110.823550] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37110.823551] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37110.823571] Call Trace:
[37110.823573] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37110.823576] [<ffffffff81187cb5>] path_init+0x315/0x400
[37110.823579] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37110.823581] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37110.823584] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37110.823586] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37110.823589] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37110.823592] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37110.823594] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37110.823596] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37110.823599] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37110.823601] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37110.823604] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37110.823607] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37110.823610] [<ffffffff81179720>] sys_open+0x20/0x30
[37110.823613] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37111.592770] softirqs last disabled at (307807): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37111.601298] CPU 1
[37111.603145] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37111.656445]
[37111.658021] Pid: 29657, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37111.667452] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37111.676671] RSP: 0018:ffff880116575d28 EFLAGS: 00000297
[37111.682062] RAX: ffff8801f89d0340 RBX: ffffffff81525ad4 RCX: 000000000000ae47
[37111.689269] RDX: 000000000000ae48 RSI: 1208000000000000 RDI: 0000000000000246
[37111.696480] RBP: ffff880116575d38 R08: 0000000000000241 R09: fffffffff6fc0241
[37111.703686] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37111.710898] R13: ffff8801f8800000 R14: ffff880116574000 R15: 0000000000000000
[37111.718108] FS: 00007f1315e20700(0000) GS:ffff8801f8800000(0000) knlGS:0000000000000000
[37111.726356] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37111.732179] CR2: 00007f130e7ef000 CR3: 000000016c3bd000 CR4: 00000000000006e0
[37111.739388] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37111.746601] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37111.753811] Process cc1 (pid: 29657, threadinfo ffff880116574000, task ffff88010d3265c0)
[37111.762055] Stack:
[37111.764147] ffffffff81199e70 ffffffff829cbf7a ffff880116575d98 ffffffff81187cb5
[37111.771789] ffff880116575d78 ffffffff8127c398 ffff8801f0d46200 ffff8801f0d46200
[37111.779434] ffff88010d2d1680 ffff8801164c2000 ffff880116575d98 ffff880116575e38
[37111.787075] Call Trace:
[37111.789603] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37111.796560] [<ffffffff81187cb5>] path_init+0x315/0x400
[37111.801864] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37111.808125] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37111.813517] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37111.820666] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37111.826582] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37111.832578] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37111.838056] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37111.843444] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37111.848750] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37111.854664] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37111.859969] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37111.865451] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37111.871794] [<ffffffff81179720>] sys_open+0x20/0x30
[37111.876838] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37111.882924] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37111.903550] Call Trace:
[37111.906078] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37111.913033] [<ffffffff81187cb5>] path_init+0x315/0x400
[37111.918334] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37111.924595] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37111.929990] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37111.935384] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37111.941299] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37111.947298] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37111.952777] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37111.958166] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37111.963470] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37111.969383] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37111.974686] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37111.980164] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37111.986505] [<ffffffff81179720>] sys_open+0x20/0x30
[37111.991552] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37112.234768] BUG: soft lockup - CPU#10 stuck for 22s! [cc1:29775]
[37112.240853] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.293935] irq event stamp: 328098
[37112.297498] hardirqs last enabled at (328097): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37112.305937] hardirqs last disabled at (328098): [<ffffffff8152596a>] save_args+0x6a/0x70
[37112.314198] softirqs last enabled at (328096): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37112.322902] softirqs last disabled at (328081): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37112.331431] CPU 10
[37112.333363] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.386694]
[37112.388268] Pid: 29775, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37112.397701] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37112.406919] RSP: 0018:ffff880104e45d28 EFLAGS: 00000297
[37112.412310] RAX: ffff8801f93d0340 RBX: ffffffff81525ad4 RCX: 000000000000f11c
[37112.419519] RDX: 000000000000f11d RSI: 1208000000000000 RDI: 0000000000000246
[37112.426731] RBP: ffff880104e45d38 R08: 0000000000000241 R09: fffffffff6fc0241
[37112.433940] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37112.441155] R13: ffff8801f9200000 R14: ffff880104e44000 R15: 0000000000000000
[37112.448371] FS: 00007fd0f07da700(0000) GS:ffff8801f9200000(0000) knlGS:0000000000000000
[37112.456617] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37112.462439] CR2: 00007fd0e9e24000 CR3: 0000000114791000 CR4: 00000000000006e0
[37112.469651] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37112.476859] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37112.484069] Process cc1 (pid: 29775, threadinfo ffff880104e44000, task ffff88010d97c5c0)
[37112.492310] Stack:
[37112.494408] ffffffff81199e70 ffffffff829cbf7a ffff880104e45d98 ffffffff81187cb5
[37112.502050] ffff880104e45d78 ffffffff8127c398 ffff88013199c240 ffff88013199c240
[37112.509688] ffff8801f0aa0a40 ffff880176b63000 ffff880104e45d98 ffff880104e45e38
[37112.517339] Call Trace:
[37112.519872] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.526826] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.532133] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.538394] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.543788] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.549182] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.555094] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.561088] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.566567] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.571960] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.577264] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.583177] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.588482] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37112.593960] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37112.600301] [<ffffffff81179720>] sys_open+0x20/0x30
[37112.605348] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37112.611433] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37112.632075] Call Trace:
[37112.634601] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.641553] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.646856] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.653118] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.658512] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.663906] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.669817] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.675815] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.681292] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.686685] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.691989] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.693469] BUG: soft lockup - CPU#3 stuck for 22s! [sh:29882]
[37112.693471] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.693496] irq event stamp: 229310
[37112.693497] hardirqs last enabled at (229309): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37112.693501] hardirqs last disabled at (229310): [<ffffffff8152596a>] save_args+0x6a/0x70
[37112.693504] softirqs last enabled at (229308): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37112.693507] softirqs last disabled at (229303): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37112.693510] CPU 3
[37112.693511] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.693534]
[37112.693535] Pid: 29882, comm: sh Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37112.693538] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37112.693542] RSP: 0018:ffff880194281c58 EFLAGS: 00000287
[37112.693544] RAX: ffff8801f8dd0340 RBX: ffffffff81525ad4 RCX: 000000000000a85f
[37112.693545] RDX: 000000000000a860 RSI: 1208000000000000 RDI: 0000000000000246
[37112.693547] RBP: ffff880194281c68 R08: 00000000006d2241 R09: fffffe4b77692241
[37112.693549] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37112.693551] R13: ffff8801f8c00000 R14: ffff880194280000 R15: 0000000000000000
[37112.693553] FS: 00007fa7cc1d1700(0000) GS:ffff8801f8c00000(0000) knlGS:0000000000000000
[37112.693555] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[37112.693556] CR2: 0000000000a82b20 CR3: 0000000194238000 CR4: 00000000000006e0
[37112.693558] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37112.693560] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37112.693562] Process sh (pid: 29882, threadinfo ffff880194280000, task ffff880074e2e280)
[37112.693563] Stack:
[37112.693564] ffffffff81199e70 ffffffff829cbf7a ffff880194281cc8 ffffffff81187cb5
[37112.693568] ffff880194281ca8 ffffffff8127c398 ffff88017b05ec80 ffff88017b05ec80
[37112.693571] ffff8800741462c0 ffff88017522e000 ffff880194281cc8 ffff880194281d68
[37112.693574] Call Trace:
[37112.693577] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.693580] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.693583] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.693586] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.693588] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.693592] [<ffffffff81012dd3>] ? native_sched_clock+0x13/0x60
[37112.693594] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.693597] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.693600] [<ffffffff810a7b19>] ? __lock_release+0x129/0x190
[37112.693603] [<ffffffff81182bfc>] ? check_unsafe_exec+0x14c/0x1a0
[37112.693606] [<ffffffff81182bbc>] ? check_unsafe_exec+0x10c/0x1a0
[37112.693609] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.693612] [<ffffffff81182e02>] open_exec+0x32/0xd0
[37112.693614] [<ffffffff81182f80>] do_execve_common+0xe0/0x2a0
[37112.693618] [<ffffffff8113c615>] ? might_fault+0xa5/0xb0
[37112.693621] [<ffffffff811831ca>] do_execve+0x3a/0x40
[37112.693624] [<ffffffff810136ca>] sys_execve+0x4a/0x80
[37112.693627] [<ffffffff8152e6dc>] stub_execve+0x6c/0xc0
[37112.693628] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37112.693648] Call Trace:
[37112.693650] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.693652] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.693655] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.693658] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.693660] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.693663] [<ffffffff81012dd3>] ? native_sched_clock+0x13/0x60
[37112.693665] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.693668] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.693671] [<ffffffff810a7b19>] ? __lock_release+0x129/0x190
[37112.693673] [<ffffffff81182bfc>] ? check_unsafe_exec+0x14c/0x1a0
[37112.693676] [<ffffffff81182bbc>] ? check_unsafe_exec+0x10c/0x1a0
[37112.693679] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.693681] [<ffffffff81182e02>] open_exec+0x32/0xd0
[37112.693684] [<ffffffff81182f80>] do_execve_common+0xe0/0x2a0
[37112.693687] [<ffffffff8113c615>] ? might_fault+0xa5/0xb0
[37112.693689] [<ffffffff811831ca>] do_execve+0x3a/0x40
[37112.693692] [<ffffffff810136ca>] sys_execve+0x4a/0x80
[37112.693694] [<ffffffff8152e6dc>] stub_execve+0x6c/0xc0
[37112.761187] BUG: soft lockup - CPU#9 stuck for 22s! [cc1:29712]
[37112.761189] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.761226] irq event stamp: 334968
[37112.761227] hardirqs last enabled at (334967): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37112.761232] hardirqs last disabled at (334968): [<ffffffff8152596a>] save_args+0x6a/0x70
[37112.761236] softirqs last enabled at (334966): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37112.761240] softirqs last disabled at (334951): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37112.761244] CPU 9
[37112.761245] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.761278]
[37112.761280] Pid: 29712, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37112.761284] RIP: 0010:[<ffffffff81199ec8>] [<ffffffff81199ec8>] vfsmount_lock_local_lock+0x58/0x60
[37112.761289] RSP: 0018:ffff88016d3a7d28 EFLAGS: 00000297
[37112.761292] RAX: ffff8801f91d0340 RBX: ffffffff81525ad4 RCX: 00000000000073a4
[37112.761294] RDX: 00000000000073a5 RSI: 1208000000000000 RDI: 0000000000000246
[37112.761297] RBP: ffff88016d3a7d38 R08: 0000000000000241 R09: fffffffff6fc0241
[37112.761299] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37112.761302] R13: ffff8801f9000000 R14: ffff88016d3a6000 R15: 0000000000000000
[37112.761305] FS: 00007f5fe6e03700(0000) GS:ffff8801f9000000(0000) knlGS:0000000000000000
[37112.761308] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37112.761310] CR2: 00007f5fe0abc000 CR3: 000000010d85a000 CR4: 00000000000006e0
[37112.761313] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37112.761316] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37112.761318] Process cc1 (pid: 29712, threadinfo ffff88016d3a6000, task ffff880146972780)
[37112.761320] Stack:
[37112.761322] ffffffff81199e70 ffffffff829cbf7a ffff88016d3a7d98 ffffffff81187cb5
[37112.761327] ffff88016d3a7d78 ffffffff8127c398 ffff8801f19ac840 ffff8801f19ac840
[37112.761332] ffff880073ae3440 ffff8801d6d40000 ffff88016d3a7d98 ffff88016d3a7e38
[37112.761337] Call Trace:
[37112.761341] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.761345] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.761349] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.761353] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.761357] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.761360] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.761365] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.761368] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.761372] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.761375] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.761379] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.761383] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.761387] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37112.761391] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37112.761395] [<ffffffff81179720>] sys_open+0x20/0x30
[37112.761399] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37112.761401] Code: 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10 39 d1 74 07 f3 90 <0f> b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53 48 83 ec 10 66 66
[37112.761429] Call Trace:
[37112.761433] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.761436] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.761440] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.761444] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.761447] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.761451] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.761454] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.761458] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.761461] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.761465] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.761468] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.761472] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.761476] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37112.761480] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37112.761484] [<ffffffff81179720>] sys_open+0x20/0x30
[37112.761488] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37112.998790] BUG: soft lockup - CPU#4 stuck for 23s! [cc1:29178]
[37112.998792] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.998818] irq event stamp: 328402
[37112.998819] hardirqs last enabled at (328401): [<ffffffff81525ad4>] restore_args+0x0/0x30
[37112.998823] hardirqs last disabled at (328402): [<ffffffff8152596a>] save_args+0x6a/0x70
[37112.998826] softirqs last enabled at (328400): [<ffffffff8106ea2c>] __do_softirq+0x14c/0x250
[37112.998829] softirqs last disabled at (328395): [<ffffffff8152f4bc>] call_softirq+0x1c/0x30
[37112.998832] CPU 4
[37112.998833] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log microcode serio_raw pcspkr iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core shpchp ioatdma dca i7core_edac edac_core bnx2 sg ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt mptsas mptscsih mptbase scsi_transport_sas dm_mod [last unloaded: scsi_wait_scan]
[37112.998856]
[37112.998858] Pid: 29178, comm: cc1 Not tainted 3.0.3 #1 IBM BladeCenter HS22V -[7871G2A]-/81Y7641
[37112.998861] RIP: 0010:[<ffffffff81199ec2>] [<ffffffff81199ec2>] vfsmount_lock_local_lock+0x52/0x60
[37112.998865] RSP: 0018:ffff8801f30b5d28 EFLAGS: 00000297
[37112.998866] RAX: ffff88047e7d0340 RBX: ffffffff81525ad4 RCX: 00000000000038a9
[37112.998868] RDX: 00000000000038aa RSI: 1208000000000000 RDI: 0000000000000246
[37112.998870] RBP: ffff8801f30b5d38 R08: 0000000000000241 R09: fffffffff6fc0241
[37112.998871] R10: 00000000000270d0 R11: 0000000000000000 R12: ffffffff8152ec6e
[37112.998873] R13: ffff88047e600000 R14: ffff8801f30b4000 R15: 0000000000000000
[37112.998875] FS: 00007f0444f31700(0000) GS:ffff88047e600000(0000) knlGS:0000000000000000
[37112.998877] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[37112.998879] CR2: 00007f043d3b3000 CR3: 00000003bf28e000 CR4: 00000000000006e0
[37112.998880] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[37112.998882] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[37112.998884] Process cc1 (pid: 29178, threadinfo ffff8801f30b4000, task ffff88018cd98340)
[37112.998886] Stack:
[37112.998887] ffffffff81199e70 ffffffff829cbf7a ffff8801f30b5d98 ffffffff81187cb5
[37112.998891] ffff8801f30b5d78 ffffffff8127c398 ffff88046deaa0c0 ffff88046deaa0c0
[37112.998894] ffff8801092f0200 ffff8803811d5000 ffff8801f30b5d98 ffff8801f30b5e38
[37112.998898] Call Trace:
[37112.998900] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.998903] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.998907] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.998909] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.998912] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.998915] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.998918] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.998920] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.998923] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.998925] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.998928] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[37112.998931] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.998934] [<ffffffff81179607>] do_sys_open+0x107/0x1e0
[37112.998937] [<ffffffff810d610f>] ? audit_syscall_entry+0x1bf/0x1f0
[37112.998940] [<ffffffff81179720>] sys_open+0x20/0x30
[37112.998943] [<ffffffff8152e202>] system_call_fastpath+0x16/0x1b
[37112.998944] Code: c7 04 24 70 9e 19 81 e8 bd dd f0 ff 48 c7 c0 40 03 1d 00 65 48 03 04 25 d0 dc 00 00 ba 00 00 01 00 f0 0f c1 10 0f b7 ca c1 ea 10
[37112.998958] d1 74 07 f3 90 0f b7 08 eb f5 c9 c3 90 55 48 89 e5 41 54 53
[37112.998964] Call Trace:
[37112.998967] [<ffffffff81199e70>] ? vfsmount_lock_local_lock_cpu+0x70/0x70
[37112.998969] [<ffffffff81187cb5>] path_init+0x315/0x400
[37112.998972] [<ffffffff8127c398>] ? __raw_spin_lock_init+0x38/0x70
[37112.998975] [<ffffffff8118961c>] path_openat+0x8c/0x3f0
[37112.998977] [<ffffffff81012129>] ? sched_clock+0x9/0x10
[37112.998980] [<ffffffff8109416d>] ? sched_clock_cpu+0xcd/0x110
[37112.998983] [<ffffffff810a178d>] ? trace_hardirqs_off+0xd/0x10
[37112.998985] [<ffffffff8109421f>] ? local_clock+0x6f/0x80
[37112.998988] [<ffffffff81189a99>] do_filp_open+0x49/0xa0
[37112.998990] [<ffffffff811982f3>] ? alloc_fd+0xc3/0x210
[37112.998992] [<ffffffff8152584b>] ? _raw_spin_unlock+0x2b/0x40
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply
* Re: [PATCH] Add regulator driver for the bq2407x family of charger ICs
From: Mark Brown @ 2011-08-24 9:07 UTC (permalink / raw)
To: Heiko Stübner; +Cc: linux-pm, Liam Girdwood
In-Reply-To: <201108232215.08788.heiko@sntech.de>
On Tue, Aug 23, 2011 at 10:15:07PM +0200, Heiko Stübner wrote:
> Am Dienstag 23 August 2011, 13:50:24 schrieb Mark Brown:
> > On Sat, Aug 20, 2011 at 10:24:51PM +0200, Heiko Stübner wrote:
> > > + } else if (max_uA >= 100000) {
> > > + dev_dbg(rdev_get_dev(rdev),
> > > + "setting current limit to 100 mA\n");
> > > + gpio_set_value(pdata->gpio_en2, 0);
> > > + gpio_set_value(pdata->gpio_en1, 0);
> > > + } else {
> > > + dev_dbg(rdev_get_dev(rdev),
> > > + "setting current limit to 0 mA\n");
> > > + gpio_set_value(pdata->gpio_en2, 1);
> > > + gpio_set_value(pdata->gpio_en1, 1);
> > > + }
> > I'd rather expect this to return an error sometimes.
> gpio_set_value is a void function, so I'm not sure what could cause an error
> here.
For example if you're asked for a limit below 100mA - disabling the
charger probably isn't a useful implementation. The disable should be
done with enable/disable.
^ permalink raw reply
* [PATCH v8 5/5] PM / DEVFREQ: add basic governors
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314174131-14194-1-git-send-email-myungjoo.ham@samsung.com>
Four CPUFREQ-like governors are provided as examples.
powersave: use the lowest frequency possible. The user (device) should
set the polling_ms as 0 because polling is useless for this governor.
performance: use the highest freqeuncy possible. The user (device)
should set the polling_ms as 0 because polling is useless for this
governor.
userspace: use the user specified frequency stored at
devfreq.user_set_freq. With sysfs support in the following patch, a user
may set the value with the sysfs interface.
simple_ondemand: simplified version of CPUFREQ's ONDEMAND governor.
When a user updates OPP entries (enable/disable/add), OPP framework
automatically notifies DEVFREQ to update operating frequency
accordingly. Thus, DEVFREQ users (device drivers) do not need to update
DEVFREQ manually with OPP entry updates or set polling_ms for powersave
, performance, userspace, or any other "static" governors.
Note that these are given only as basic examples for governors and any
devices with DEVFREQ may implement their own governors with the drivers
and use them.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changed from v7
- Userspace uses its own sysfs interface.
Changed from v5
- Seperated governor files from devfreq.c
- Allow simple ondemand to be tuned for each device
---
Documentation/ABI/testing/sysfs-devices-power | 9 ++
drivers/devfreq/Kconfig | 36 ++++++++
drivers/devfreq/Makefile | 4 +
drivers/devfreq/governor_performance.c | 24 +++++
drivers/devfreq/governor_powersave.c | 24 +++++
drivers/devfreq/governor_simpleondemand.c | 88 ++++++++++++++++++
drivers/devfreq/governor_userspace.c | 119 +++++++++++++++++++++++++
include/linux/devfreq.h | 41 +++++++++
8 files changed, 345 insertions(+), 0 deletions(-)
create mode 100644 drivers/devfreq/governor_performance.c
create mode 100644 drivers/devfreq/governor_powersave.c
create mode 100644 drivers/devfreq/governor_simpleondemand.c
create mode 100644 drivers/devfreq/governor_userspace.c
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
index 57f4591..c7f6977 100644
--- a/Documentation/ABI/testing/sysfs-devices-power
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -202,3 +202,12 @@ Description:
shows the requested polling interval of the corresponding
device. The values are represented in ms. If the value is less
than 1 jiffy, it is considered to be 0, which means no polling.
+
+What: /sys/devices/.../power/devfreq_userspace_set_freq
+Date: August 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_userspace_set_freq sets
+ and shows the user specified frequency in kHz. This sysfs
+ entry is created and managed by userspace DEVFREQ governor.
+ If other governors are used, it won't be supported.
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 1fb42de..643b055 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -34,6 +34,42 @@ menuconfig PM_DEVFREQ
if PM_DEVFREQ
+comment "DEVFREQ Governors"
+
+config DEVFREQ_GOV_SIMPLE_ONDEMAND
+ bool "Simple Ondemand"
+ help
+ Chooses frequency based on the recent load on the device. Works
+ similar as ONDEMAND governor of CPUFREQ does. A device with
+ Simple-Ondemand should be able to provide busy/total counter
+ values that imply the usage rate. A device may provide tuned
+ values to the governor with data field at devfreq_add_device().
+
+config DEVFREQ_GOV_PERFORMANCE
+ bool "Performance"
+ help
+ Sets the frequency at the maximum available frequency.
+ This governor always returns UINT_MAX as frequency so that
+ the DEVFREQ framework returns the highest frequency available
+ at any time.
+
+config DEVFREQ_GOV_POWERSAVE
+ bool "Powersave"
+ help
+ Sets the frequency at the minimum available frequency.
+ This governor always returns 0 as frequency so that
+ the DEVFREQ framework returns the lowest frequency available
+ at any time.
+
+config DEVFREQ_GOV_USERSPACE
+ bool "Userspace"
+ help
+ Sets the frequency at the user specified one.
+ This governor returns the user configured frequency if there
+ has been an input to /sys/devices/.../power/devfreq_set_freq.
+ Otherwise, the governor does not change the frequnecy
+ given at the initialization.
+
comment "DEVFREQ Drivers"
endif # PM_DEVFREQ
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index 168934a..4564a89 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -1 +1,5 @@
obj-$(CONFIG_PM_DEVFREQ) += devfreq.o
+obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) += governor_simpleondemand.o
+obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE) += governor_performance.o
+obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o
+obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o
diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c
new file mode 100644
index 0000000..c47eff8
--- /dev/null
+++ b/drivers/devfreq/governor_performance.c
@@ -0,0 +1,24 @@
+/*
+ * linux/drivers/devfreq/governor_performance.c
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/devfreq.h>
+
+static int devfreq_performance_func(struct devfreq *df,
+ unsigned long *freq)
+{
+ *freq = UINT_MAX; /* devfreq_do will run "floor" */
+ return 0;
+}
+
+struct devfreq_governor devfreq_performance = {
+ .name = "performance",
+ .get_target_freq = devfreq_performance_func,
+};
diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c
new file mode 100644
index 0000000..4f128d8
--- /dev/null
+++ b/drivers/devfreq/governor_powersave.c
@@ -0,0 +1,24 @@
+/*
+ * linux/drivers/devfreq/governor_powersave.c
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/devfreq.h>
+
+static int devfreq_powersave_func(struct devfreq *df,
+ unsigned long *freq)
+{
+ *freq = 0; /* devfreq_do will run "ceiling" to 0 */
+ return 0;
+}
+
+struct devfreq_governor devfreq_powersave = {
+ .name = "powersave",
+ .get_target_freq = devfreq_powersave_func,
+};
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
new file mode 100644
index 0000000..18fe8be
--- /dev/null
+++ b/drivers/devfreq/governor_simpleondemand.c
@@ -0,0 +1,88 @@
+/*
+ * linux/drivers/devfreq/governor_simpleondemand.c
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/errno.h>
+#include <linux/devfreq.h>
+#include <linux/math64.h>
+
+/* Default constants for DevFreq-Simple-Ondemand (DFSO) */
+#define DFSO_UPTHRESHOLD (90)
+#define DFSO_DOWNDIFFERENCTIAL (5)
+static int devfreq_simple_ondemand_func(struct devfreq *df,
+ unsigned long *freq)
+{
+ struct devfreq_dev_status stat;
+ int err = df->profile->get_dev_status(df->dev, &stat);
+ unsigned long long a, b;
+ unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;
+ unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;
+ struct devfreq_simple_ondemand_data *data = df->data;
+
+ if (err)
+ return err;
+
+ if (data) {
+ if (data->upthreshold)
+ dfso_upthreshold = data->upthreshold;
+ if (data->downdifferential)
+ dfso_downdifferential = data->downdifferential;
+ }
+ if (dfso_upthreshold > 100 ||
+ dfso_upthreshold < dfso_downdifferential)
+ return -EINVAL;
+
+ /* Assume MAX if it is going to be divided by zero */
+ if (stat.total_time == 0) {
+ *freq = UINT_MAX;
+ return 0;
+ }
+
+ /* Prevent overflow */
+ if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) {
+ stat.busy_time >>= 7;
+ stat.total_time >>= 7;
+ }
+
+ /* Set MAX if it's busy enough */
+ if (stat.busy_time * 100 >
+ stat.total_time * dfso_upthreshold) {
+ *freq = UINT_MAX;
+ return 0;
+ }
+
+ /* Set MAX if we do not know the initial frequency */
+ if (stat.current_frequency == 0) {
+ *freq = UINT_MAX;
+ return 0;
+ }
+
+ /* Keep the current frequency */
+ if (stat.busy_time * 100 >
+ stat.total_time * (dfso_upthreshold - dfso_downdifferential)) {
+ *freq = stat.current_frequency;
+ return 0;
+ }
+
+ /* Set the desired frequency based on the load */
+ a = stat.busy_time;
+ a *= stat.current_frequency;
+ b = div_u64(a, stat.total_time);
+ b *= 100;
+ b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2));
+ *freq = (unsigned long) b;
+
+ return 0;
+}
+
+struct devfreq_governor devfreq_simple_ondemand = {
+ .name = "simple_ondemand",
+ .get_target_freq = devfreq_simple_ondemand_func,
+};
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
new file mode 100644
index 0000000..53a4574
--- /dev/null
+++ b/drivers/devfreq/governor_userspace.c
@@ -0,0 +1,119 @@
+/*
+ * linux/drivers/devfreq/governor_simpleondemand.c
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/slab.h>
+#include <linux/device.h>
+#include <linux/devfreq.h>
+#include <linux/pm.h>
+#include "governor.h"
+
+struct userspace_data {
+ unsigned long user_frequency;
+ bool valid;
+};
+
+static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq)
+{
+ struct userspace_data *data = df->data;
+
+ if (!data->valid)
+ *freq = df->previous_freq; /* No user freq specified yet */
+ else
+ *freq = data->user_frequency;
+ return 0;
+}
+
+static ssize_t store_freq(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct devfreq *devfreq = get_devfreq(dev);
+ struct userspace_data *data;
+ unsigned long wanted;
+ int err = 0;
+
+ if (IS_ERR(devfreq)) {
+ err = PTR_ERR(devfreq);
+ goto out;
+ }
+ data = devfreq->data;
+
+ sscanf(buf, "%lu", &wanted);
+ data->user_frequency = wanted;
+ data->valid = true;
+ err = update_devfreq(devfreq);
+ if (err == 0)
+ err = count;
+out:
+ return err;
+}
+
+static ssize_t show_freq(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct devfreq *devfreq = get_devfreq(dev);
+ struct userspace_data *data;
+ int err = 0;
+
+ if (IS_ERR(devfreq)) {
+ err = PTR_ERR(devfreq);
+ goto out;
+ }
+ data = devfreq->data;
+
+ if (data->valid)
+ err = sprintf(buf, "%lu\n", data->user_frequency);
+ else
+ err = sprintf(buf, "undefined\n");
+out:
+ return err;
+}
+
+static DEVICE_ATTR(devfreq_userspace_set_freq, 0644, show_freq, store_freq);
+static struct attribute *dev_entries[] = {
+ &dev_attr_devfreq_userspace_set_freq.attr,
+ NULL,
+};
+static struct attribute_group dev_attr_group = {
+ .name = power_group_name,
+ .attrs = dev_entries,
+};
+
+static int userspace_init(struct devfreq *devfreq)
+{
+ int err = 0;
+ struct userspace_data *data = kzalloc(sizeof(struct userspace_data),
+ GFP_KERNEL);
+
+ if (!data) {
+ err = -ENOMEM;
+ goto out;
+ }
+ data->valid = false;
+ devfreq->data = data;
+
+ sysfs_merge_group(&devfreq->dev->kobj, &dev_attr_group);
+out:
+ return err;
+}
+
+static void userspace_exit(struct devfreq *devfreq)
+{
+ sysfs_unmerge_group(&devfreq->dev->kobj, &dev_attr_group);
+ kfree(devfreq->data);
+ devfreq->data = NULL;
+}
+
+struct devfreq_governor devfreq_userspace = {
+ .name = "userspace",
+ .get_target_freq = devfreq_userspace_func,
+ .init = userspace_init,
+ .exit = userspace_exit,
+};
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index fdc6916..cbafcdf 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -13,6 +13,7 @@
#ifndef __LINUX_DEVFREQ_H__
#define __LINUX_DEVFREQ_H__
+#include <linux/opp.h>
#include <linux/notifier.h>
#define DEVFREQ_NAME_LEN 16
@@ -65,6 +66,8 @@ struct devfreq_governor {
* "devfreq_monitor" executions to reevaluate
* frequency/voltage of the device. Set by
* profile's polling_ms interval.
+ * @user_set_freq User specified adequete frequency value (thru sysfs
+ * interface). Governors may and may not use this value.
* @data Private data of the governor. The devfreq framework does not
* touch this.
*
@@ -82,6 +85,7 @@ struct devfreq {
unsigned long previous_freq;
unsigned int next_polling;
+ unsigned long user_set_freq; /* governors may ignore this. */
void *data; /* private data for governors */
};
@@ -91,6 +95,37 @@ extern int devfreq_add_device(struct device *dev,
struct devfreq_governor *governor,
void *data);
extern int devfreq_remove_device(struct device *dev);
+
+#ifdef CONFIG_DEVFREQ_GOV_POWERSAVE
+extern struct devfreq_governor devfreq_powersave;
+#endif
+#ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE
+extern struct devfreq_governor devfreq_performance;
+#endif
+#ifdef CONFIG_DEVFREQ_GOV_USERSPACE
+extern struct devfreq_governor devfreq_userspace;
+#endif
+#ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
+extern struct devfreq_governor devfreq_simple_ondemand;
+/**
+ * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
+ * and devfreq_add_device
+ * @ upthreshold If the load is over this value, the frequency jumps.
+ * Specify 0 to use the default. Valid value = 0 to 100.
+ * @ downdifferential If the load is under upthreshold - downdifferential,
+ * the governor may consider slowing the frequency down.
+ * Specify 0 to use the default. Valid value = 0 to 100.
+ * downdifferential < upthreshold must hold.
+ *
+ * If the fed devfreq_simple_ondemand_data pointer is NULL to the governor,
+ * the governor uses the default values.
+ */
+struct devfreq_simple_ondemand_data {
+ unsigned int upthreshold;
+ unsigned int downdifferential;
+};
+#endif
+
#else /* !CONFIG_PM_DEVFREQ */
static int devfreq_add_device(struct device *dev,
struct devfreq_dev_profile *profile,
@@ -104,6 +139,12 @@ static int devfreq_remove_device(struct device *dev)
{
return 0;
}
+
+#define devfreq_powersave NULL
+#define devfreq_performance NULL
+#define devfreq_userspace NULL
+#define devfreq_simple_ondemand NULL
+
#endif /* CONFIG_PM_DEVFREQ */
#endif /* __LINUX_DEVFREQ_H__ */
--
1.7.4.1
^ permalink raw reply related
* [PATCH v8 4/5] PM / DEVFREQ: add internal interfaces for governors
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314174131-14194-1-git-send-email-myungjoo.ham@samsung.com>
- get_devfreq(): governors may convert struct dev -> struct devfreq
- update_devfreq(): governors may notify DEVFREQ core to reevaluate
frequencies.
- Governors may have .init and .exit callbacks
In order to use the internal interface, get_devfreq() and
update_devfreq(), governor should include "governor.h"
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/devfreq/devfreq.c | 32 ++++++++++++++++++++++++--------
drivers/devfreq/governor.h | 20 ++++++++++++++++++++
include/linux/devfreq.h | 2 ++
3 files changed, 46 insertions(+), 8 deletions(-)
create mode 100644 drivers/devfreq/governor.h
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 5bbece6..8de3b21 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -65,10 +65,10 @@ static struct devfreq *find_device_devfreq(struct device *dev)
/**
* get_devfreq() - find devfreq struct. a wrapped find_device_devfreq()
- * with mutex protection.
+ * with mutex protection. exported for governors
* @dev: device pointer used to lookup device devfreq.
*/
-static struct devfreq *get_devfreq(struct device *dev)
+struct devfreq *get_devfreq(struct device *dev)
{
struct devfreq *ret;
@@ -113,17 +113,15 @@ static int devfreq_do(struct devfreq *devfreq)
}
/**
- * devfreq_update() - Notify that the device OPP has been changed.
- * @dev: the device whose OPP has been changed.
+ * update_devfreq() - Notify that the device OPP or frequency requirement
+ * has been changed. This function is exported for governors.
+ * @devfreq: the devfreq instance.
*/
-static int devfreq_update(struct notifier_block *nb, unsigned long type,
- void *devp)
+int update_devfreq(struct devfreq *devfreq)
{
- struct devfreq *devfreq;
int err = 0;
mutex_lock(&devfreq_list_lock);
- devfreq = container_of(nb, struct devfreq, nb);
/* Reevaluate the proper frequency */
err = devfreq_do(devfreq);
mutex_unlock(&devfreq_list_lock);
@@ -131,6 +129,18 @@ static int devfreq_update(struct notifier_block *nb, unsigned long type,
}
/**
+ * devfreq_update() - Notify that the device OPP has been changed.
+ * @dev: the device whose OPP has been changed.
+ */
+static int devfreq_update(struct notifier_block *nb, unsigned long type,
+ void *devp)
+{
+ struct devfreq *devfreq = container_of(nb, struct devfreq, nb);
+
+ return update_devfreq(devfreq);
+}
+
+/**
* devfreq_monitor() - Periodically run devfreq_do()
* @work: the work struct used to run devfreq_monitor periodically.
*
@@ -254,6 +264,9 @@ int devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile,
list_add(&devfreq->node, &devfreq_list);
+ if (governor->init)
+ governor->init(devfreq);
+
if (devfreq_wq && devfreq->next_polling && !polling) {
polling = true;
queue_delayed_work(devfreq_wq, &devfreq_work,
@@ -295,6 +308,9 @@ int devfreq_remove_device(struct device *dev)
sysfs_unmerge_group(&dev->kobj, &dev_attr_group);
+ if (devfreq->governor->exit)
+ devfreq->governor->exit(devfreq);
+
list_del(&devfreq->node);
srcu_notifier_chain_unregister(nh, &devfreq->nb);
kfree(devfreq);
diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h
new file mode 100644
index 0000000..bb5d964
--- /dev/null
+++ b/drivers/devfreq/governor.h
@@ -0,0 +1,20 @@
+/*
+ * governor.h - internal header for governors.
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This header is for devfreq governors in drivers/devfreq/
+ */
+
+#ifndef _GOVERNOR_H
+#define _GOVERNOR_H
+
+extern struct devfreq *get_devfreq(struct device *dev);
+extern int update_devfreq(struct devfreq *devfreq);
+
+#endif /* _GOVERNOR_H */
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 8252238..fdc6916 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -46,6 +46,8 @@ struct devfreq_dev_profile {
struct devfreq_governor {
char name[DEVFREQ_NAME_LEN];
int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
+ int (*init)(struct devfreq *this);
+ void (*exit)(struct devfreq *this);
};
/**
--
1.7.4.1
^ permalink raw reply related
* [PATCH v8 3/5] PM / DEVFREQ: add common sysfs interfaces
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314174131-14194-1-git-send-email-myungjoo.ham@samsung.com>
Device specific sysfs interface /sys/devices/.../power/devfreq_*
- governor R: name of governor
- cur_freq R: current frequency
- max_freq R: maximum operable frequency
- min_freq R: minimum operable frequency
- polling_interval R: polling interval in ms given with devfreq profile
W: update polling interval.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
--
Changed from v7
- removed set_freq from the common devfreq interface
- added get_devfreq, a mutex-protected wrapper for find_device_devfreq
(for sysfs interfaces and later with governor-support)
- corrected ABI documentation.
Changed from v6
- poling_interval is writable.
Changed from v5
- updated devferq_update usage.
Changed from v4
- removed system-wide sysfs interface
- removed tickling sysfs interface
- added set_freq for userspace governor (and any other governors that
require user input)
Changed from v3
- corrected sysfs API usage
- corrected error messages
- moved sysfs entry location
- added sysfs entries
Changed from v2
- add ABI entries for devfreq sysfs interface
---
Documentation/ABI/testing/sysfs-devices-power | 37 ++++++
drivers/devfreq/devfreq.c | 150 +++++++++++++++++++++++++
2 files changed, 187 insertions(+), 0 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
index 8ffbc25..57f4591 100644
--- a/Documentation/ABI/testing/sysfs-devices-power
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -165,3 +165,40 @@ Description:
Not all drivers support this attribute. If it isn't supported,
attempts to read or write it will yield I/O errors.
+
+What: /sys/devices/.../power/devfreq_governor
+Date: July 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_governor shows the name
+ of the governor used by the corresponding device.
+
+What: /sys/devices/.../power/devfreq_cur_freq
+Date: July 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_cur_freq shows the current
+ frequency of the corresponding device.
+
+What: /sys/devices/.../power/devfreq_max_freq
+Date: July 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_max_freq shows the
+ maximum operable frequency of the corresponding device.
+
+What: /sys/devices/.../power/devfreq_min_freq
+Date: July 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_min_freq shows the
+ minimum operable frequency of the corresponding device.
+
+What: /sys/devices/.../power/devfreq_polling_interval
+Date: July 2011
+Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
+Description:
+ The /sys/devices/.../power/devfreq_polling_interval sets and
+ shows the requested polling interval of the corresponding
+ device. The values are represented in ms. If the value is less
+ than 1 jiffy, it is considered to be 0, which means no polling.
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index df63bdc..5bbece6 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -37,6 +37,8 @@ static struct delayed_work devfreq_work;
static LIST_HEAD(devfreq_list);
static DEFINE_MUTEX(devfreq_list_lock);
+static struct attribute_group dev_attr_group;
+
/**
* find_device_devfreq() - find devfreq struct using device pointer
* @dev: device pointer used to lookup device devfreq.
@@ -62,6 +64,22 @@ static struct devfreq *find_device_devfreq(struct device *dev)
}
/**
+ * get_devfreq() - find devfreq struct. a wrapped find_device_devfreq()
+ * with mutex protection.
+ * @dev: device pointer used to lookup device devfreq.
+ */
+static struct devfreq *get_devfreq(struct device *dev)
+{
+ struct devfreq *ret;
+
+ mutex_lock(&devfreq_list_lock);
+ ret = find_device_devfreq(dev);
+ mutex_unlock(&devfreq_list_lock);
+
+ return ret;
+}
+
+/**
* devfreq_do() - Check the usage profile of a given device and configure
* frequency and voltage accordingly
* @devfreq: devfreq info of the given device
@@ -149,6 +167,8 @@ static void devfreq_monitor(struct work_struct *work)
dev_err(devfreq->dev, "Due to devfreq_do error(%d), devfreq(%s) is removed from the device\n",
error, devfreq->governor->name);
+ sysfs_unmerge_group(&devfreq->dev->kobj,
+ &dev_attr_group);
list_del(&devfreq->node);
kfree(devfreq);
@@ -239,6 +259,8 @@ int devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile,
queue_delayed_work(devfreq_wq, &devfreq_work,
devfreq->next_polling);
}
+
+ sysfs_merge_group(&dev->kobj, &dev_attr_group);
out:
mutex_unlock(&devfreq_list_lock);
@@ -271,6 +293,8 @@ int devfreq_remove_device(struct device *dev)
goto out;
}
+ sysfs_unmerge_group(&dev->kobj, &dev_attr_group);
+
list_del(&devfreq->node);
srcu_notifier_chain_unregister(nh, &devfreq->nb);
kfree(devfreq);
@@ -279,6 +303,132 @@ out:
return 0;
}
+static ssize_t show_governor(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct devfreq *df = get_devfreq(dev);
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+ if (!df->governor)
+ return -EINVAL;
+
+ return sprintf(buf, "%s\n", df->governor->name);
+}
+
+static ssize_t show_freq(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct devfreq *df = get_devfreq(dev);
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+
+ return sprintf(buf, "%lu\n", df->previous_freq);
+}
+
+static ssize_t show_max_freq(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct devfreq *df = get_devfreq(dev);
+ unsigned long freq = ULONG_MAX;
+ struct opp *opp;
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+ if (!df->dev)
+ return -EINVAL;
+
+ opp = opp_find_freq_floor(df->dev, &freq);
+ if (IS_ERR(opp))
+ return PTR_ERR(opp);
+
+ return sprintf(buf, "%lu\n", freq);
+}
+
+static ssize_t show_min_freq(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct devfreq *df = get_devfreq(dev);
+ unsigned long freq = 0;
+ struct opp *opp;
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+ if (!df->dev)
+ return -EINVAL;
+
+ opp = opp_find_freq_ceil(df->dev, &freq);
+ if (IS_ERR(opp))
+ return PTR_ERR(opp);
+
+ return sprintf(buf, "%lu\n", freq);
+}
+
+static ssize_t show_polling_interval(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct devfreq *df = get_devfreq(dev);
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+ if (!df->profile)
+ return -EINVAL;
+
+ return sprintf(buf, "%d\n", df->profile->polling_ms);
+}
+
+static ssize_t store_polling_interval(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct devfreq *df = get_devfreq(dev);
+ unsigned int value;
+ int ret;
+
+ if (IS_ERR(df))
+ return PTR_ERR(df);
+ if (!df->profile)
+ return -EINVAL;
+
+ ret = sscanf(buf, "%u", &value);
+ if (ret != 1)
+ return -EINVAL;
+
+ df->profile->polling_ms = value;
+ df->next_polling = df->polling_jiffies
+ = msecs_to_jiffies(value);
+
+ mutex_lock(&devfreq_list_lock);
+ if (df->next_polling > 0 && !polling) {
+ polling = true;
+ queue_delayed_work(devfreq_wq, &devfreq_work,
+ df->next_polling);
+ }
+ mutex_unlock(&devfreq_list_lock);
+
+ return count;
+}
+
+static DEVICE_ATTR(devfreq_governor, 0444, show_governor, NULL);
+static DEVICE_ATTR(devfreq_cur_freq, 0444, show_freq, NULL);
+static DEVICE_ATTR(devfreq_max_freq, 0444, show_max_freq, NULL);
+static DEVICE_ATTR(devfreq_min_freq, 0444, show_min_freq, NULL);
+static DEVICE_ATTR(devfreq_polling_interval, 0644, show_polling_interval,
+ store_polling_interval);
+static struct attribute *dev_entries[] = {
+ &dev_attr_devfreq_governor.attr,
+ &dev_attr_devfreq_cur_freq.attr,
+ &dev_attr_devfreq_max_freq.attr,
+ &dev_attr_devfreq_min_freq.attr,
+ &dev_attr_devfreq_polling_interval.attr,
+ NULL,
+};
+static struct attribute_group dev_attr_group = {
+ .name = power_group_name,
+ .attrs = dev_entries,
+};
+
/**
* devfreq_init() - Initialize data structure for devfreq framework and
* start polling registered devfreq devices.
--
1.7.4.1
^ permalink raw reply related
* [PATCH v8 2/5] PM: Introduce DEVFREQ: generic DVFS framework with device-specific OPPs
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314174131-14194-1-git-send-email-myungjoo.ham@samsung.com>
With OPPs, a device may have multiple operable frequency and voltage
sets. However, there can be multiple possible operable sets and a system
will need to choose one from them. In order to reduce the power
consumption (by reducing frequency and voltage) without affecting the
performance too much, a Dynamic Voltage and Frequency Scaling (DVFS)
scheme may be used.
This patch introduces the DVFS capability to non-CPU devices with OPPs.
DVFS is a techique whereby the frequency and supplied voltage of a
device is adjusted on-the-fly. DVFS usually sets the frequency as low
as possible with given conditions (such as QoS assurance) and adjusts
voltage according to the chosen frequency in order to reduce power
consumption and heat dissipation.
The generic DVFS for devices, DEVFREQ, may appear quite similar with
/drivers/cpufreq. However, CPUFREQ does not allow to have multiple
devices registered and is not suitable to have multiple heterogenous
devices with different (but simple) governors.
Normally, DVFS mechanism controls frequency based on the demand for
the device, and then, chooses voltage based on the chosen frequency.
DEVFREQ also controls the frequency based on the governor's frequency
recommendation and let OPP pick up the pair of frequency and voltage
based on the recommended frequency. Then, the chosen OPP is passed to
device driver's "target" callback.
When PM QoS is going to be used with the DEVFREQ device, the device
driver should enable OPPs that are appropriate with the current PM QoS
requests. In order to do so, the device driver may call opp_enable and
opp_disable at the notifier callback of PM QoS so that PM QoS's
update_target() call enables the appropriate OPPs. Note that at least
one of OPPs should be enabled at any time; be careful when there is a
transition.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mike Turquette <mturquette@ti.com>
---
The test code with board support for Exynos4-NURI is at
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/devfreq
---
Thank you for your valuable comments, Rafael, Greg, Pavel, Colin, Mike,
and Kevin.
At v8, there is no changes since v7
Changes from v6
- Type revised for timing variables
- Removed unnecessary code and variable
Changes at v6-resubmit from v6
- Use jiffy directly instead of ktime
- Be prepared for profile->polling_ms changes (not supported fully at
this stage)
Changes from v5
- Uses OPP availability change notifier
- Removed devfreq_interval. Uses one jiffy instead. DEVFREQ adjusts
polling interval based on the interval requirement of DEVFREQ
devices.
- Moved devfreq to /drivers/devfreq to accomodate devfreq-related files
including governors and devfreq drivers.
- Coding style revised.
- Updated devfreq_add_device interface to get tunable values.
Changed from v4
- Removed tickle, which is a duplicated feature; PM QoS can do the same.
- Allow to extend polling interval if devices have longer polling intervals.
- Relocated private data of governors.
- Removed system-wide sysfs
Changed from v3
- In kerneldoc comments, DEVFREQ has ben replaced by devfreq
- Revised removing devfreq entries with error mechanism
- Added and revised comments
- Removed unnecessary codes
- Allow to give a name to a governor
- Bugfix: a tickle call may cancel an older tickle call that is still in
effect.
Changed from v2
- Code style revised and cleaned up.
- Remove DEVFREQ entries that incur errors except for EAGAIN
- Bug fixed: tickle for devices without polling governors
Changes from v1(RFC)
- Rename: DVFS --> DEVFREQ
- Revised governor design
. Governor receives the whole struct devfreq
. Governor should gather usage information (thru get_dev_status) itself
- Periodic monitoring runs only when needed.
- DEVFREQ no more deals with voltage information directly
- Removed some printks.
- Some cosmetics update
- Use freezable_wq.
---
drivers/Kconfig | 2 +
drivers/Makefile | 2 +
drivers/devfreq/Kconfig | 39 ++++++
drivers/devfreq/Makefile | 1 +
drivers/devfreq/devfreq.c | 297 +++++++++++++++++++++++++++++++++++++++++++++
include/linux/devfreq.h | 107 ++++++++++++++++
6 files changed, 448 insertions(+), 0 deletions(-)
create mode 100644 drivers/devfreq/Kconfig
create mode 100644 drivers/devfreq/Makefile
create mode 100644 drivers/devfreq/devfreq.c
create mode 100644 include/linux/devfreq.h
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 95b9e7e..a1efd75 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -130,4 +130,6 @@ source "drivers/iommu/Kconfig"
source "drivers/virt/Kconfig"
+source "drivers/devfreq/Kconfig"
+
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 7fa433a..97c957b 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -127,3 +127,5 @@ obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
# Virtualization drivers
obj-$(CONFIG_VIRT_DRIVERS) += virt/
+
+obj-$(CONFIG_PM_DEVFREQ) += devfreq/
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
new file mode 100644
index 0000000..1fb42de
--- /dev/null
+++ b/drivers/devfreq/Kconfig
@@ -0,0 +1,39 @@
+config ARCH_HAS_DEVFREQ
+ bool
+ depends on ARCH_HAS_OPP
+ help
+ Denotes that the architecture supports DEVFREQ. If the architecture
+ supports multiple OPP entries per device and the frequency of the
+ devices with OPPs may be altered dynamically, the architecture
+ supports DEVFREQ.
+
+menuconfig PM_DEVFREQ
+ bool "Generic Dynamic Voltage and Frequency Scaling (DVFS) support"
+ depends on PM_OPP && ARCH_HAS_DEVFREQ
+ help
+ With OPP support, a device may have a list of frequencies and
+ voltages available. DEVFREQ, a generic DVFS framework can be
+ registered for a device with OPP support in order to let the
+ governor provided to DEVFREQ choose an operating frequency
+ based on the OPP's list and the policy given with DEVFREQ.
+
+ Each device may have its own governor and policy. DEVFREQ can
+ reevaluate the device state periodically and/or based on the
+ OPP list changes (each frequency/voltage pair in OPP may be
+ disabled or enabled).
+
+ Like some CPUs with CPUFREQ, a device may have multiple clocks.
+ However, because the clock frequencies of a single device are
+ determined by the single device's state, an instance of DEVFREQ
+ is attached to a single device and returns a "representative"
+ clock frequency from the OPP of the device, which is also attached
+ to a device by 1-to-1. The device registering DEVFREQ takes the
+ responsiblity to "interpret" the frequency listed in OPP and
+ to set its every clock accordingly with the "target" callback
+ given to DEVFREQ.
+
+if PM_DEVFREQ
+
+comment "DEVFREQ Drivers"
+
+endif # PM_DEVFREQ
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
new file mode 100644
index 0000000..168934a
--- /dev/null
+++ b/drivers/devfreq/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_PM_DEVFREQ) += devfreq.o
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
new file mode 100644
index 0000000..df63bdc
--- /dev/null
+++ b/drivers/devfreq/devfreq.c
@@ -0,0 +1,297 @@
+/*
+ * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
+ * for Non-CPU Devices Based on OPP.
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/opp.h>
+#include <linux/devfreq.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+#include <linux/list.h>
+#include <linux/printk.h>
+#include <linux/hrtimer.h>
+
+/*
+ * devfreq_work periodically monitors every registered device.
+ * The minimum polling interval is one jiffy. The polling interval is
+ * determined by the minimum polling period among all polling devfreq
+ * devices. The resolution of polling interval is one jiffy.
+ */
+static bool polling;
+static struct workqueue_struct *devfreq_wq;
+static struct delayed_work devfreq_work;
+
+/* The list of all device-devfreq */
+static LIST_HEAD(devfreq_list);
+static DEFINE_MUTEX(devfreq_list_lock);
+
+/**
+ * find_device_devfreq() - find devfreq struct using device pointer
+ * @dev: device pointer used to lookup device devfreq.
+ *
+ * Search the list of device devfreqs and return the matched device's
+ * devfreq info. devfreq_list_lock should be held by the caller.
+ */
+static struct devfreq *find_device_devfreq(struct device *dev)
+{
+ struct devfreq *tmp_devfreq;
+
+ if (unlikely(IS_ERR_OR_NULL(dev))) {
+ pr_err("DEVFREQ: %s: Invalid parameters\n", __func__);
+ return ERR_PTR(-EINVAL);
+ }
+
+ list_for_each_entry(tmp_devfreq, &devfreq_list, node) {
+ if (tmp_devfreq->dev == dev)
+ return tmp_devfreq;
+ }
+
+ return ERR_PTR(-ENODEV);
+}
+
+/**
+ * devfreq_do() - Check the usage profile of a given device and configure
+ * frequency and voltage accordingly
+ * @devfreq: devfreq info of the given device
+ */
+static int devfreq_do(struct devfreq *devfreq)
+{
+ struct opp *opp;
+ unsigned long freq;
+ int err;
+
+ err = devfreq->governor->get_target_freq(devfreq, &freq);
+ if (err)
+ return err;
+
+ opp = opp_find_freq_ceil(devfreq->dev, &freq);
+ if (opp == ERR_PTR(-ENODEV))
+ opp = opp_find_freq_floor(devfreq->dev, &freq);
+
+ if (IS_ERR(opp))
+ return PTR_ERR(opp);
+
+ if (devfreq->previous_freq == freq)
+ return 0;
+
+ err = devfreq->profile->target(devfreq->dev, opp);
+ if (err)
+ return err;
+
+ devfreq->previous_freq = freq;
+ return 0;
+}
+
+/**
+ * devfreq_update() - Notify that the device OPP has been changed.
+ * @dev: the device whose OPP has been changed.
+ */
+static int devfreq_update(struct notifier_block *nb, unsigned long type,
+ void *devp)
+{
+ struct devfreq *devfreq;
+ int err = 0;
+
+ mutex_lock(&devfreq_list_lock);
+ devfreq = container_of(nb, struct devfreq, nb);
+ /* Reevaluate the proper frequency */
+ err = devfreq_do(devfreq);
+ mutex_unlock(&devfreq_list_lock);
+ return err;
+}
+
+/**
+ * devfreq_monitor() - Periodically run devfreq_do()
+ * @work: the work struct used to run devfreq_monitor periodically.
+ *
+ */
+static void devfreq_monitor(struct work_struct *work)
+{
+ static unsigned long last_polled_at;
+ struct devfreq *devfreq, *tmp;
+ int error;
+ unsigned long jiffies_passed;
+ unsigned long next_jiffies = ULONG_MAX, now = jiffies;
+
+ /* Initially last_polled_at = 0, polling every device at bootup */
+ jiffies_passed = now - last_polled_at;
+ last_polled_at = now;
+ if (jiffies_passed == 0)
+ jiffies_passed = 1;
+
+ mutex_lock(&devfreq_list_lock);
+
+ list_for_each_entry_safe(devfreq, tmp, &devfreq_list, node) {
+ if (devfreq->next_polling == 0)
+ continue;
+
+ /*
+ * Reduce more next_polling if devfreq_wq took an extra
+ * delay. (i.e., CPU has been idled.)
+ */
+ if (devfreq->next_polling <= jiffies_passed) {
+ error = devfreq_do(devfreq);
+
+ /* Remove a devfreq with an error. */
+ if (error && error != -EAGAIN) {
+ dev_err(devfreq->dev, "Due to devfreq_do error(%d), devfreq(%s) is removed from the device\n",
+ error, devfreq->governor->name);
+
+ list_del(&devfreq->node);
+ kfree(devfreq);
+
+ continue;
+ }
+ devfreq->next_polling = devfreq->polling_jiffies;
+
+ /* No more polling required (polling_ms changed) */
+ if (devfreq->next_polling == 0)
+ continue;
+ } else {
+ devfreq->next_polling -= jiffies_passed;
+ }
+
+ next_jiffies = (next_jiffies > devfreq->next_polling) ?
+ devfreq->next_polling : next_jiffies;
+ }
+
+ if (next_jiffies > 0 && next_jiffies < ULONG_MAX) {
+ polling = true;
+ queue_delayed_work(devfreq_wq, &devfreq_work, next_jiffies);
+ } else {
+ polling = false;
+ }
+
+ mutex_unlock(&devfreq_list_lock);
+}
+
+/**
+ * devfreq_add_device() - Add devfreq feature to the device
+ * @dev: the device to add devfreq feature.
+ * @profile: device-specific profile to run devfreq.
+ * @governor: the policy to choose frequency.
+ * @data: private data for the governor. The devfreq framework does not
+ * touch this value.
+ */
+int devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile,
+ struct devfreq_governor *governor, void *data)
+{
+ struct devfreq *devfreq;
+ struct srcu_notifier_head *nh;
+ int err = 0;
+
+ if (!dev || !profile || !governor) {
+ dev_err(dev, "%s: Invalid parameters.\n", __func__);
+ return -EINVAL;
+ }
+
+ mutex_lock(&devfreq_list_lock);
+
+ devfreq = find_device_devfreq(dev);
+ if (!IS_ERR(devfreq)) {
+ dev_err(dev, "%s: Unable to create devfreq for the device. It already has one.\n", __func__);
+ err = -EINVAL;
+ goto out;
+ }
+
+ devfreq = kzalloc(sizeof(struct devfreq), GFP_KERNEL);
+ if (!devfreq) {
+ dev_err(dev, "%s: Unable to create devfreq for the device\n",
+ __func__);
+ err = -ENOMEM;
+ goto out;
+ }
+
+ devfreq->dev = dev;
+ devfreq->profile = profile;
+ devfreq->governor = governor;
+ devfreq->next_polling = devfreq->polling_jiffies
+ = msecs_to_jiffies(devfreq->profile->polling_ms);
+ devfreq->previous_freq = profile->initial_freq;
+ devfreq->data = data;
+
+ devfreq->nb.notifier_call = devfreq_update;
+ nh = opp_get_notifier(dev);
+ if (IS_ERR(nh)) {
+ err = PTR_ERR(nh);
+ goto out;
+ }
+ err = srcu_notifier_chain_register(nh, &devfreq->nb);
+ if (err)
+ goto out;
+
+ list_add(&devfreq->node, &devfreq_list);
+
+ if (devfreq_wq && devfreq->next_polling && !polling) {
+ polling = true;
+ queue_delayed_work(devfreq_wq, &devfreq_work,
+ devfreq->next_polling);
+ }
+out:
+ mutex_unlock(&devfreq_list_lock);
+
+ return err;
+}
+
+/**
+ * devfreq_remove_device() - Remove devfreq feature from a device.
+ * @device: the device to remove devfreq feature.
+ */
+int devfreq_remove_device(struct device *dev)
+{
+ struct devfreq *devfreq;
+ struct srcu_notifier_head *nh;
+ int err = 0;
+
+ if (!dev)
+ return -EINVAL;
+
+ mutex_lock(&devfreq_list_lock);
+ devfreq = find_device_devfreq(dev);
+ if (IS_ERR(devfreq)) {
+ err = PTR_ERR(devfreq);
+ goto out;
+ }
+
+ nh = opp_get_notifier(dev);
+ if (IS_ERR(nh)) {
+ err = PTR_ERR(nh);
+ goto out;
+ }
+
+ list_del(&devfreq->node);
+ srcu_notifier_chain_unregister(nh, &devfreq->nb);
+ kfree(devfreq);
+out:
+ mutex_unlock(&devfreq_list_lock);
+ return 0;
+}
+
+/**
+ * devfreq_init() - Initialize data structure for devfreq framework and
+ * start polling registered devfreq devices.
+ */
+static int __init devfreq_init(void)
+{
+ mutex_lock(&devfreq_list_lock);
+ polling = false;
+ devfreq_wq = create_freezable_workqueue("devfreq_wq");
+ INIT_DELAYED_WORK_DEFERRABLE(&devfreq_work, devfreq_monitor);
+ mutex_unlock(&devfreq_list_lock);
+
+ devfreq_monitor(&devfreq_work.work);
+ return 0;
+}
+late_initcall(devfreq_init);
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
new file mode 100644
index 0000000..8252238
--- /dev/null
+++ b/include/linux/devfreq.h
@@ -0,0 +1,107 @@
+/*
+ * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
+ * for Non-CPU Devices Based on OPP.
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * MyungJoo Ham <myungjoo.ham@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX_DEVFREQ_H__
+#define __LINUX_DEVFREQ_H__
+
+#include <linux/notifier.h>
+
+#define DEVFREQ_NAME_LEN 16
+
+struct devfreq;
+struct devfreq_dev_status {
+ /* both since the last measure */
+ unsigned long total_time;
+ unsigned long busy_time;
+ unsigned long current_frequency;
+};
+
+struct devfreq_dev_profile {
+ unsigned long max_freq; /* may be larger than the actual value */
+ unsigned long initial_freq;
+ unsigned int polling_ms; /* 0 for at opp change only */
+
+ int (*target)(struct device *dev, struct opp *opp);
+ int (*get_dev_status)(struct device *dev,
+ struct devfreq_dev_status *stat);
+};
+
+/**
+ * struct devfreq_governor - Devfreq policy governor
+ * @name Governor's name
+ * @get_target_freq Returns desired operating frequency for the device.
+ * Basically, get_target_freq will run
+ * devfreq_dev_profile.get_dev_status() to get the
+ * status of the device (load = busy_time / total_time).
+ */
+struct devfreq_governor {
+ char name[DEVFREQ_NAME_LEN];
+ int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
+};
+
+/**
+ * struct devfreq - Device devfreq structure
+ * @node list node - contains the devices with devfreq that have been
+ * registered.
+ * @dev device pointer
+ * @profile device-specific devfreq profile
+ * @governor method how to choose frequency based on the usage.
+ * @nb notifier block registered to the corresponding OPP to get
+ * notified for frequency availability updates.
+ * @polling_jiffies interval in jiffies.
+ * @previous_freq previously configured frequency value.
+ * @next_polling the number of remaining jiffies to poll with
+ * "devfreq_monitor" executions to reevaluate
+ * frequency/voltage of the device. Set by
+ * profile's polling_ms interval.
+ * @data Private data of the governor. The devfreq framework does not
+ * touch this.
+ *
+ * This structure stores the devfreq information for a give device.
+ */
+struct devfreq {
+ struct list_head node;
+
+ struct device *dev;
+ struct devfreq_dev_profile *profile;
+ struct devfreq_governor *governor;
+ struct notifier_block nb;
+
+ unsigned long polling_jiffies;
+ unsigned long previous_freq;
+ unsigned int next_polling;
+
+ void *data; /* private data for governors */
+};
+
+#if defined(CONFIG_PM_DEVFREQ)
+extern int devfreq_add_device(struct device *dev,
+ struct devfreq_dev_profile *profile,
+ struct devfreq_governor *governor,
+ void *data);
+extern int devfreq_remove_device(struct device *dev);
+#else /* !CONFIG_PM_DEVFREQ */
+static int devfreq_add_device(struct device *dev,
+ struct devfreq_dev_profile *profile,
+ struct devfreq_governor *governor,
+ void *data)
+{
+ return 0;
+}
+
+static int devfreq_remove_device(struct device *dev)
+{
+ return 0;
+}
+#endif /* CONFIG_PM_DEVFREQ */
+
+#endif /* __LINUX_DEVFREQ_H__ */
--
1.7.4.1
^ permalink raw reply related
* [PATCH v8 1/5] PM / OPP: Add OPP availability change notifier.
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314174131-14194-1-git-send-email-myungjoo.ham@samsung.com>
The patch enables to register notifier_block for an OPP-device in order
to get notified for any changes in the availability of OPPs of the
device. For example, if a new OPP is inserted or enable/disable status
of an OPP is changed, the notifier is executed.
This enables the usage of opp_add, opp_enable, and opp_disable to
directly take effect with any connected entities such as CPUFREQ or
DEVFREQ.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mike Turquette <mturquette@ti.com>
---
Added at devfreq patch set v6 replacing devfreq_update calls at OPP.
---
drivers/base/power/opp.c | 29 +++++++++++++++++++++++++++++
include/linux/opp.h | 12 ++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index b23de18..e6b4c89 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -73,6 +73,7 @@ struct opp {
* RCU usage: nodes are not modified in the list of device_opp,
* however addition is possible and is secured by dev_opp_list_lock
* @dev: device pointer
+ * @head: notifier head to notify the OPP availability changes.
* @opp_list: list of opps
*
* This is an internal data structure maintaining the link to opps attached to
@@ -83,6 +84,7 @@ struct device_opp {
struct list_head node;
struct device *dev;
+ struct srcu_notifier_head head;
struct list_head opp_list;
};
@@ -404,6 +406,7 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
}
dev_opp->dev = dev;
+ srcu_init_notifier_head(&dev_opp->head);
INIT_LIST_HEAD(&dev_opp->opp_list);
/* Secure the device list modification */
@@ -428,6 +431,11 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
list_add_rcu(&new_opp->node, head);
mutex_unlock(&dev_opp_list_lock);
+ /*
+ * Notify the changes in the availability of the operable
+ * frequency/voltage list.
+ */
+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp);
return 0;
}
@@ -504,6 +512,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
mutex_unlock(&dev_opp_list_lock);
synchronize_rcu();
+ /* Notify the change of the OPP availability */
+ if (availability_req)
+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ENABLE,
+ new_opp);
+ else
+ srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE,
+ new_opp);
+
/* clean up old opp */
new_opp = opp;
goto out;
@@ -643,3 +659,16 @@ void opp_free_cpufreq_table(struct device *dev,
*table = NULL;
}
#endif /* CONFIG_CPU_FREQ */
+
+/** opp_get_notifier() - find notifier_head of the device with opp
+ * @dev: device pointer used to lookup device OPPs.
+ */
+struct srcu_notifier_head *opp_get_notifier(struct device *dev)
+{
+ struct device_opp *dev_opp = find_device_opp(dev);
+
+ if (IS_ERR(dev_opp))
+ return ERR_PTR(PTR_ERR(dev_opp)); /* matching type */
+
+ return &dev_opp->head;
+}
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 7020e97..87a9208 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -16,9 +16,14 @@
#include <linux/err.h>
#include <linux/cpufreq.h>
+#include <linux/notifier.h>
struct opp;
+enum opp_event {
+ OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
+};
+
#if defined(CONFIG_PM_OPP)
unsigned long opp_get_voltage(struct opp *opp);
@@ -40,6 +45,8 @@ int opp_enable(struct device *dev, unsigned long freq);
int opp_disable(struct device *dev, unsigned long freq);
+struct srcu_notifier_head *opp_get_notifier(struct device *dev);
+
#else
static inline unsigned long opp_get_voltage(struct opp *opp)
{
@@ -89,6 +96,11 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
{
return 0;
}
+
+struct srcu_notifier_head *opp_get_notifier(struct device *dev)
+{
+ return ERR_PTR(-EINVAL);
+}
#endif /* CONFIG_PM */
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
--
1.7.4.1
^ permalink raw reply related
* [PATCH v8 0/5] DEVFREQ, DVFS Framework for Non-CPU Devices.
From: MyungJoo Ham @ 2011-08-24 8:22 UTC (permalink / raw)
To: linux-pm; +Cc: Len Brown, Greg Kroah-Hartman, Kyungmin Park, Thomas Gleixner
In-Reply-To: <1314086044-24659-1-git-send-email-myungjoo.ham@samsung.com>
The patchset revision v8 has minor updates since v7 and v6.
- Allow governors to have their own sysfs interface and init/exit callbacks.
The patches 1/5 (OPP notifier) and 2/5 (DEVFREQ core) have no changes since v7.
There has been reordering between "add common sysfs interfaces" patch
and "add basic governors" (3/5 and 5/5)
"add internal interfaces for governors (4/5)" patch has been newly
introduced at v8 patchset.
For a usage example, please look at
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/devfreq
In the above git tree, DVFS (dynamic voltage and frequency scaling) mechanism
is applied to the memory bus of Exynos4210 for Exynos4210-NURI boards.
In the example, the LPDDR2 DRAM frequency changes between 133, 266, and 400MHz
and other related clocks simply follow the determined DDR RAM clock.
The DEVFREQ driver for Exynos4210 memory bus is at
/drivers/devfreq/exynos4210_memorybus.c in the git tree.
In the dd (writing and reading 360MiB) test with NURI board, the memory
throughput was not changed (the performance is not deteriorated) while
the SoC power consumption has been reduced by 1%. When the memory access
is not that intense while the CPU is heavily used, the SoC power consumption
has been reduced by 6%. The power consumption has been compared with the
case using the conventional Exynos4210 CPUFREQ driver, which sets memory
bus frequency according to the CPU core frequency. Besides, when the CPU core
running slow and the memory access is intense, the performance (memory
throughput) has been increased by 11% (with higher SoC power consumption of
5%). The tested governor is "simple-ondemand".
MyungJoo Ham (5):
PM / OPP: Add OPP availability change notifier.
PM: Introduce DEVFREQ: generic DVFS framework with device-specific
OPPs
PM / DEVFREQ: add common sysfs interfaces
PM / DEVFREQ: add internal interfaces for governors
PM / DEVFREQ: add basic governors
Documentation/ABI/testing/sysfs-devices-power | 46 +++
drivers/Kconfig | 2 +
drivers/Makefile | 2 +
drivers/base/power/opp.c | 29 ++
drivers/devfreq/Kconfig | 75 ++++
drivers/devfreq/Makefile | 5 +
drivers/devfreq/devfreq.c | 463 +++++++++++++++++++++++++
drivers/devfreq/governor.h | 20 +
drivers/devfreq/governor_performance.c | 24 ++
drivers/devfreq/governor_powersave.c | 24 ++
drivers/devfreq/governor_simpleondemand.c | 88 +++++
drivers/devfreq/governor_userspace.c | 119 +++++++
include/linux/devfreq.h | 150 ++++++++
include/linux/opp.h | 12 +
14 files changed, 1059 insertions(+), 0 deletions(-)
create mode 100644 drivers/devfreq/Kconfig
create mode 100644 drivers/devfreq/Makefile
create mode 100644 drivers/devfreq/devfreq.c
create mode 100644 drivers/devfreq/governor.h
create mode 100644 drivers/devfreq/governor_performance.c
create mode 100644 drivers/devfreq/governor_powersave.c
create mode 100644 drivers/devfreq/governor_simpleondemand.c
create mode 100644 drivers/devfreq/governor_userspace.c
create mode 100644 include/linux/devfreq.h
--
1.7.4.1
^ permalink raw reply
* Re: [PATCH 4/6] cgroup: don't use subsys->can_attach_task() or ->attach_task()
From: Tejun Heo @ 2011-08-24 7:54 UTC (permalink / raw)
To: Matt Helsley
Cc: lizf, paul, Daisuke Nishimura, linux-kernel, linux-pm,
Ingo Molnar, containers
In-Reply-To: <20110824015739.GE28444@count0.beaverton.ibm.com>
Hello,
On Tue, Aug 23, 2011 at 06:57:39PM -0700, Matt Helsley wrote:
> On Wed, Aug 24, 2011 at 12:19:58AM +0200, Tejun Heo wrote:
>
> <snip>
>
> > * In cgroup_freezer, remove unnecessary NULL assignments to unused
> > methods. It's useless and very prone to get out of sync, which
> > already happened.
>
> You could post this part independently -- that might be best since
> I guess the taskset bits will need more discussion.
Urgh... I really think subsystems which aren't very isolated should
have its own tree. Going through -mm works well if the changes are
isolated or all inter-dependent changes go through -mm too but it
stops working as soon as the changes start span across other git
trees. If cgroup isn't expected to see a lot of changes in this cycle
(if so, please set up a git tree, it isn't difficult), the best
solution, I think, would be sticking w/ Rafael's branch.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCHSET] cgroup: introduce cgroup_taskset and consolidate subsys methods
From: Tejun Heo @ 2011-08-24 7:49 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: containers, lizf, linux-kernel, linux-pm, paul
In-Reply-To: <20110824011428.GC23979@somewhere>
Hello, Frederic.
On Wed, Aug 24, 2011 at 03:14:30AM +0200, Frederic Weisbecker wrote:
> > 0001-cgroup-subsys-attach_task-should-be-called-after-mig.patch
> > 0002-cgroup-improve-old-cgroup-handling-in-cgroup_attach_.patch
> > 0003-cgroup-introduce-cgroup_taskset-and-use-it-in-subsys.patch
> > 0004-cgroup-don-t-use-subsys-can_attach_task-or-attach_ta.patch
> > 0005-cgroup-cpuset-don-t-use-ss-pre_attach.patch
> > 0006-cgroup-kill-subsys-can_attach_task-pre_attach-and-at.patch
>
> I don't understand the point on patches 3,4,5,6
>
> Why pushing the task iterations down to the subsystems?
I'll try again.
It seems like methods were added to serve the immediate need of the
particular user at the time and that in turn led to addition of
callbacks which were both superflous and incomplete (the bullet points
in the original message list them). This seems to have happened
because extra interface was added without trying to make the existing
interface complete.
The interface is complicated and cumbersome to use - are
[can_]attach() called first or [can_]attach_task()? What about
cancelation? What if a subsys wants to perform operations across
multiple tasks atomically?
In general, iteration-by-callback is painful to use. Establishing
common context (be it synchronization domain or shared variables)
becomes very cumbersome and implementation becomes fragmented and
difficult to follow. For example, imagine how it would be like to use
list if we had call_for_each_list_entry(func, list_head) instead of
the control-loop style iterators we have know.
So, using iterators enables making all relevant information to each
stage of attach so that only one callback is required for each step -
the way it should be. In addition, it makes it far easier for
subsystems to implement more involved logic in their methods.
I tried to make cgroup_freezer behave better which requires better
synchronization against the freezer and, with the current interface,
it's extremely ugly and painful. The new interface is complete, easy
to understand and use with far less subtleties.
Thanks.
--
tejun
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox