All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuidle: move field disable from per-driver to per-cpu
@ 2012-06-14  2:52 ShuoX Liu
  2012-06-14 14:41 ` Andrew J. Schorr
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: ShuoX Liu @ 2012-06-14  2:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Brown, Len, Zhang, Yanmin, Andrew J. Schorr,
	Deepthi Dharwar

From: ShuoX Liu <shuox.liu@intel.com>

Andrew J.Schorr raises a question. When he changes the disable setting
on a single CPU, it affects all the other CPUs. Basically, currently,
the disable field is per-driver instead of per-cpu. All the C states of
the same driver are shared by all CPU in the same machine.

Below patch changes field disable to per-cpu, so we could set this
separately for each cpu.

Reported-by: Andrew J.Schorr <aschorr@telemetry-investments.com>
Reviewed-by: Yanmin Zhang <yanmin_zhang@intel.com>
Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
---
 drivers/cpuidle/cpuidle.c        |    1 -
 drivers/cpuidle/governors/menu.c |    5 +++--
 drivers/cpuidle/sysfs.c          |   21 ++++++++++++---------
 include/linux/cpuidle.h          |    2 +-
 4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d90519c..04e4b76 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -265,7 +265,6 @@ static void poll_idle_init(struct cpuidle_driver *drv)
 	state->power_usage = -1;
 	state->flags = 0;
 	state->enter = poll_idle;
-	state->disable = 0;
 }
 #else
 static void poll_idle_init(struct cpuidle_driver *drv) {}
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 0633575..8391d93 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -281,7 +281,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 	 * unless the timer is happening really really soon.
 	 */
 	if (data->expected_us > 5 &&
-		drv->states[CPUIDLE_DRIVER_STATE_START].disable == 0)
+		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
 		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
 
 	/*
@@ -290,8 +290,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 	 */
 	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
 		struct cpuidle_state *s = &drv->states[i];
+		struct cpuidle_state_usage *su = &dev->states_usage[i];
 
-		if (s->disable)
+		if (su->disable)
 			continue;
 		if (s->target_residency > data->predicted_us)
 			continue;
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 88032b4..5f809e3 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -217,7 +217,8 @@ struct cpuidle_state_attr {
 	struct attribute attr;
 	ssize_t (*show)(struct cpuidle_state *, \
 					struct cpuidle_state_usage *, char *);
-	ssize_t (*store)(struct cpuidle_state *, const char *, size_t);
+	ssize_t (*store)(struct cpuidle_state *, \
+			struct cpuidle_state_usage *, const char *, size_t);
 };
 
 #define define_one_state_ro(_name, show) \
@@ -233,21 +234,22 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
 	return sprintf(buf, "%u\n", state->_name);\
 }
 
-#define define_store_state_function(_name) \
+#define define_store_state_ull_function(_name) \
 static ssize_t store_state_##_name(struct cpuidle_state *state, \
+		struct cpuidle_state_usage *state_usage, \
 		const char *buf, size_t size) \
 { \
-	long value; \
+	unsigned long long value; \
 	int err; \
 	if (!capable(CAP_SYS_ADMIN)) \
 		return -EPERM; \
-	err = kstrtol(buf, 0, &value); \
+	err = kstrtoull(buf, 0, &value); \
 	if (err) \
 		return err; \
 	if (value) \
-		state->disable = 1; \
+		state_usage->_name = 1; \
 	else \
-		state->disable = 0; \
+		state_usage->_name = 0; \
 	return size; \
 }
 
@@ -273,8 +275,8 @@ define_show_state_ull_function(usage)
 define_show_state_ull_function(time)
 define_show_state_str_function(name)
 define_show_state_str_function(desc)
-define_show_state_function(disable)
-define_store_state_function(disable)
+define_show_state_ull_function(disable)
+define_store_state_ull_function(disable)
 
 define_one_state_ro(name, show_state_name);
 define_one_state_ro(desc, show_state_desc);
@@ -318,10 +320,11 @@ static ssize_t cpuidle_state_store(struct kobject *kobj,
 {
 	int ret = -EIO;
 	struct cpuidle_state *state = kobj_to_state(kobj);
+	struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj);
 	struct cpuidle_state_attr *cattr = attr_to_stateattr(attr);
 
 	if (cattr->store)
-		ret = cattr->store(state, buf, size);
+		ret = cattr->store(state, state_usage, buf, size);
 
 	return ret;
 }
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 6c26a3d..8570012 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -34,6 +34,7 @@ struct cpuidle_driver;
 struct cpuidle_state_usage {
 	void		*driver_data;
 
+	unsigned long long	disable;
 	unsigned long long	usage;
 	unsigned long long	time; /* in US */
 };
@@ -46,7 +47,6 @@ struct cpuidle_state {
 	unsigned int	exit_latency; /* in US */
 	int		power_usage; /* in mW */
 	unsigned int	target_residency; /* in US */
-	unsigned int    disable;
 
 	int (*enter)	(struct cpuidle_device *dev,
 			struct cpuidle_driver *drv,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpuidle: move field disable from per-driver to per-cpu
  2012-06-14  2:52 [PATCH] cpuidle: move field disable from per-driver to per-cpu ShuoX Liu
@ 2012-06-14 14:41 ` Andrew J. Schorr
  2012-06-15 12:08 ` Deepthi Dharwar
  2012-06-22 23:10 ` Andrew Morton
  2 siblings, 0 replies; 6+ messages in thread
From: Andrew J. Schorr @ 2012-06-14 14:41 UTC (permalink / raw)
  To: ShuoX Liu
  Cc: linux-kernel, Andrew Morton, Brown, Len, Zhang, Yanmin, Deepthi Dharwar

Hi,

On Thu, Jun 14, 2012 at 10:52:48AM +0800, ShuoX Liu wrote:
> Andrew J.Schorr raises a question. When he changes the disable setting
> on a single CPU, it affects all the other CPUs. Basically, currently,
> the disable field is per-driver instead of per-cpu. All the C states of
> the same driver are shared by all CPU in the same machine.
> 
> Below patch changes field disable to per-cpu, so we could set this
> separately for each cpu.

Thanks.  I have not tested this, but it looks very useful to have the
flexibility to disable certain C states on a subset of the cores.  The current
implementation affecting all cores is much less powerful.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpuidle: move field disable from per-driver to per-cpu
  2012-06-14  2:52 [PATCH] cpuidle: move field disable from per-driver to per-cpu ShuoX Liu
  2012-06-14 14:41 ` Andrew J. Schorr
@ 2012-06-15 12:08 ` Deepthi Dharwar
  2012-06-18  6:42   ` Yanmin Zhang
  2012-06-22 23:10 ` Andrew Morton
  2 siblings, 1 reply; 6+ messages in thread
From: Deepthi Dharwar @ 2012-06-15 12:08 UTC (permalink / raw)
  To: shuox.liu
  Cc: linux-kernel, Andrew Morton, Brown, Len, Zhang, Yanmin, Andrew J. Schorr

On 06/14/2012 08:22 AM, ShuoX Liu wrote:

> From: ShuoX Liu <shuox.liu@intel.com>
> 
> Andrew J.Schorr raises a question. When he changes the disable setting
> on a single CPU, it affects all the other CPUs. Basically, currently,
> the disable field is per-driver instead of per-cpu. All the C states of
> the same driver are shared by all CPU in the same machine.
> 
> Below patch changes field disable to per-cpu, so we could set this
> separately for each cpu.
> 


This would help us have asymmetric C-states on cpus.

> Reported-by: Andrew J.Schorr <aschorr@telemetry-investments.com>
> Reviewed-by: Yanmin Zhang <yanmin_zhang@intel.com>
> Signed-off-by: ShuoX Liu <shuox.liu@intel.com>


Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>

> ---
>  drivers/cpuidle/cpuidle.c        |    1 -
>  drivers/cpuidle/governors/menu.c |    5 +++--
>  drivers/cpuidle/sysfs.c          |   21 ++++++++++++---------
>  include/linux/cpuidle.h          |    2 +-
>  4 files changed, 16 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index d90519c..04e4b76 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -265,7 +265,6 @@ static void poll_idle_init(struct cpuidle_driver *drv)
>  	state->power_usage = -1;
>  	state->flags = 0;
>  	state->enter = poll_idle;
> -	state->disable = 0;
>  }
>  #else
>  static void poll_idle_init(struct cpuidle_driver *drv) {}
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index 0633575..8391d93 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -281,7 +281,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>  	 * unless the timer is happening really really soon.
>  	 */
>  	if (data->expected_us > 5 &&
> -		drv->states[CPUIDLE_DRIVER_STATE_START].disable == 0)
> +		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
>  		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
> 
>  	/*
> @@ -290,8 +290,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>  	 */
>  	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
>  		struct cpuidle_state *s = &drv->states[i];
> +		struct cpuidle_state_usage *su = &dev->states_usage[i];
> 
> -		if (s->disable)
> +		if (su->disable)
>  			continue;
>  		if (s->target_residency > data->predicted_us)
>  			continue;
> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> index 88032b4..5f809e3 100644
> --- a/drivers/cpuidle/sysfs.c
> +++ b/drivers/cpuidle/sysfs.c
> @@ -217,7 +217,8 @@ struct cpuidle_state_attr {
>  	struct attribute attr;
>  	ssize_t (*show)(struct cpuidle_state *, \
>  					struct cpuidle_state_usage *, char *);
> -	ssize_t (*store)(struct cpuidle_state *, const char *, size_t);
> +	ssize_t (*store)(struct cpuidle_state *, \
> +			struct cpuidle_state_usage *, const char *, size_t);
>  };
> 
>  #define define_one_state_ro(_name, show) \
> @@ -233,21 +234,22 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
>  	return sprintf(buf, "%u\n", state->_name);\
>  }
> 
> -#define define_store_state_function(_name) \
> +#define define_store_state_ull_function(_name) \
>  static ssize_t store_state_##_name(struct cpuidle_state *state, \
> +		struct cpuidle_state_usage *state_usage, \
>  		const char *buf, size_t size) \
>  { \
> -	long value; \
> +	unsigned long long value; \
>  	int err; \
>  	if (!capable(CAP_SYS_ADMIN)) \
>  		return -EPERM; \
> -	err = kstrtol(buf, 0, &value); \
> +	err = kstrtoull(buf, 0, &value); \
>  	if (err) \
>  		return err; \
>  	if (value) \
> -		state->disable = 1; \
> +		state_usage->_name = 1; \
>  	else \
> -		state->disable = 0; \
> +		state_usage->_name = 0; \
>  	return size; \
>  }
> 
> @@ -273,8 +275,8 @@ define_show_state_ull_function(usage)
>  define_show_state_ull_function(time)
>  define_show_state_str_function(name)
>  define_show_state_str_function(desc)
> -define_show_state_function(disable)
> -define_store_state_function(disable)
> +define_show_state_ull_function(disable)
> +define_store_state_ull_function(disable)
> 
>  define_one_state_ro(name, show_state_name);
>  define_one_state_ro(desc, show_state_desc);
> @@ -318,10 +320,11 @@ static ssize_t cpuidle_state_store(struct kobject *kobj,
>  {
>  	int ret = -EIO;
>  	struct cpuidle_state *state = kobj_to_state(kobj);
> +	struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj);
>  	struct cpuidle_state_attr *cattr = attr_to_stateattr(attr);
> 
>  	if (cattr->store)
> -		ret = cattr->store(state, buf, size);
> +		ret = cattr->store(state, state_usage, buf, size);
> 
>  	return ret;
>  }
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index 6c26a3d..8570012 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -34,6 +34,7 @@ struct cpuidle_driver;
>  struct cpuidle_state_usage {
>  	void		*driver_data;
> 
> +	unsigned long long	disable;
>  	unsigned long long	usage;
>  	unsigned long long	time; /* in US */
>  };
> @@ -46,7 +47,6 @@ struct cpuidle_state {
>  	unsigned int	exit_latency; /* in US */
>  	int		power_usage; /* in mW */
>  	unsigned int	target_residency; /* in US */
> -	unsigned int    disable;
> 
>  	int (*enter)	(struct cpuidle_device *dev,
>  			struct cpuidle_driver *drv,



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpuidle: move field disable from per-driver to per-cpu
  2012-06-15 12:08 ` Deepthi Dharwar
@ 2012-06-18  6:42   ` Yanmin Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Yanmin Zhang @ 2012-06-18  6:42 UTC (permalink / raw)
  To: Deepthi Dharwar, lenb
  Cc: shuox.liu, linux-kernel, Andrew Morton, Brown, Len, Zhang,
	Yanmin, Andrew J. Schorr, linux-pm

On Fri, 2012-06-15 at 17:38 +0530, Deepthi Dharwar wrote:
> On 06/14/2012 08:22 AM, ShuoX Liu wrote:
> 
> > From: ShuoX Liu <shuox.liu@intel.com>
> > 
> > Andrew J.Schorr raises a question. When he changes the disable setting
> > on a single CPU, it affects all the other CPUs. Basically, currently,
> > the disable field is per-driver instead of per-cpu. All the C states of
> > the same driver are shared by all CPU in the same machine.
> > 
> > Below patch changes field disable to per-cpu, so we could set this
> > separately for each cpu.
> > 
> 
> 
> This would help us have asymmetric C-states on cpus.
> 
> > Reported-by: Andrew J.Schorr <aschorr@telemetry-investments.com>
> > Reviewed-by: Yanmin Zhang <yanmin_zhang@intel.com>
> > Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
> 
> 
> Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Len,

Would you like to accept the patch into your testing tree?
Both Deepthi Dharwar and Andrew J. Schorr  acked the patch is
useful.

> 
> > ---
> >  drivers/cpuidle/cpuidle.c        |    1 -
> >  drivers/cpuidle/governors/menu.c |    5 +++--
> >  drivers/cpuidle/sysfs.c          |   21 ++++++++++++---------
> >  include/linux/cpuidle.h          |    2 +-
> >  4 files changed, 16 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> > index d90519c..04e4b76 100644
> > --- a/drivers/cpuidle/cpuidle.c
> > +++ b/drivers/cpuidle/cpuidle.c
> > @@ -265,7 +265,6 @@ static void poll_idle_init(struct cpuidle_driver *drv)
> >  	state->power_usage = -1;
> >  	state->flags = 0;
> >  	state->enter = poll_idle;
> > -	state->disable = 0;
> >  }
> >  #else
> >  static void poll_idle_init(struct cpuidle_driver *drv) {}
> > diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> > index 0633575..8391d93 100644
> > --- a/drivers/cpuidle/governors/menu.c
> > +++ b/drivers/cpuidle/governors/menu.c
> > @@ -281,7 +281,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
> >  	 * unless the timer is happening really really soon.
> >  	 */
> >  	if (data->expected_us > 5 &&
> > -		drv->states[CPUIDLE_DRIVER_STATE_START].disable == 0)
> > +		dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
> >  		data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
> > 
> >  	/*
> > @@ -290,8 +290,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
> >  	 */
> >  	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
> >  		struct cpuidle_state *s = &drv->states[i];
> > +		struct cpuidle_state_usage *su = &dev->states_usage[i];
> > 
> > -		if (s->disable)
> > +		if (su->disable)
> >  			continue;
> >  		if (s->target_residency > data->predicted_us)
> >  			continue;
> > diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> > index 88032b4..5f809e3 100644
> > --- a/drivers/cpuidle/sysfs.c
> > +++ b/drivers/cpuidle/sysfs.c
> > @@ -217,7 +217,8 @@ struct cpuidle_state_attr {
> >  	struct attribute attr;
> >  	ssize_t (*show)(struct cpuidle_state *, \
> >  					struct cpuidle_state_usage *, char *);
> > -	ssize_t (*store)(struct cpuidle_state *, const char *, size_t);
> > +	ssize_t (*store)(struct cpuidle_state *, \
> > +			struct cpuidle_state_usage *, const char *, size_t);
> >  };
> > 
> >  #define define_one_state_ro(_name, show) \
> > @@ -233,21 +234,22 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \
> >  	return sprintf(buf, "%u\n", state->_name);\
> >  }
> > 
> > -#define define_store_state_function(_name) \
> > +#define define_store_state_ull_function(_name) \
> >  static ssize_t store_state_##_name(struct cpuidle_state *state, \
> > +		struct cpuidle_state_usage *state_usage, \
> >  		const char *buf, size_t size) \
> >  { \
> > -	long value; \
> > +	unsigned long long value; \
> >  	int err; \
> >  	if (!capable(CAP_SYS_ADMIN)) \
> >  		return -EPERM; \
> > -	err = kstrtol(buf, 0, &value); \
> > +	err = kstrtoull(buf, 0, &value); \
> >  	if (err) \
> >  		return err; \
> >  	if (value) \
> > -		state->disable = 1; \
> > +		state_usage->_name = 1; \
> >  	else \
> > -		state->disable = 0; \
> > +		state_usage->_name = 0; \
> >  	return size; \
> >  }
> > 
> > @@ -273,8 +275,8 @@ define_show_state_ull_function(usage)
> >  define_show_state_ull_function(time)
> >  define_show_state_str_function(name)
> >  define_show_state_str_function(desc)
> > -define_show_state_function(disable)
> > -define_store_state_function(disable)
> > +define_show_state_ull_function(disable)
> > +define_store_state_ull_function(disable)
> > 
> >  define_one_state_ro(name, show_state_name);
> >  define_one_state_ro(desc, show_state_desc);
> > @@ -318,10 +320,11 @@ static ssize_t cpuidle_state_store(struct kobject *kobj,
> >  {
> >  	int ret = -EIO;
> >  	struct cpuidle_state *state = kobj_to_state(kobj);
> > +	struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj);
> >  	struct cpuidle_state_attr *cattr = attr_to_stateattr(attr);
> > 
> >  	if (cattr->store)
> > -		ret = cattr->store(state, buf, size);
> > +		ret = cattr->store(state, state_usage, buf, size);
> > 
> >  	return ret;
> >  }
> > diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> > index 6c26a3d..8570012 100644
> > --- a/include/linux/cpuidle.h
> > +++ b/include/linux/cpuidle.h
> > @@ -34,6 +34,7 @@ struct cpuidle_driver;
> >  struct cpuidle_state_usage {
> >  	void		*driver_data;
> > 
> > +	unsigned long long	disable;
> >  	unsigned long long	usage;
> >  	unsigned long long	time; /* in US */
> >  };
> > @@ -46,7 +47,6 @@ struct cpuidle_state {
> >  	unsigned int	exit_latency; /* in US */
> >  	int		power_usage; /* in mW */
> >  	unsigned int	target_residency; /* in US */
> > -	unsigned int    disable;
> > 
> >  	int (*enter)	(struct cpuidle_device *dev,
> >  			struct cpuidle_driver *drv,
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cpuidle: move field disable from per-driver to per-cpu
  2012-06-14  2:52 [PATCH] cpuidle: move field disable from per-driver to per-cpu ShuoX Liu
  2012-06-14 14:41 ` Andrew J. Schorr
  2012-06-15 12:08 ` Deepthi Dharwar
@ 2012-06-22 23:10 ` Andrew Morton
  2012-06-24  9:46   ` Zhang, Yanmin
  2 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2012-06-22 23:10 UTC (permalink / raw)
  To: shuox.liu
  Cc: linux-kernel, Brown, Len, Zhang, Yanmin, Andrew J. Schorr,
	Deepthi Dharwar

On Thu, 14 Jun 2012 10:52:48 +0800
ShuoX Liu <shuox.liu@intel.com> wrote:

> From: ShuoX Liu <shuox.liu@intel.com>
> 
> Andrew J.Schorr raises a question. When he changes the disable setting
> on a single CPU, it affects all the other CPUs. Basically, currently,
> the disable field is per-driver instead of per-cpu. All the C states of
> the same driver are shared by all CPU in the same machine.
> 
> Below patch changes field disable to per-cpu, so we could set this
> separately for each cpu.
> 
> ...
>
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -34,6 +34,7 @@ struct cpuidle_driver;
>  struct cpuidle_state_usage {
>  	void		*driver_data;
>  
> +	unsigned long long	disable;

hrmpf.  We're using 64 bits for this where one bit would do, afaict
because the magic macros in drivers/cpuidle/sysfs.c are using %llu.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] cpuidle: move field disable from per-driver to per-cpu
  2012-06-22 23:10 ` Andrew Morton
@ 2012-06-24  9:46   ` Zhang, Yanmin
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Yanmin @ 2012-06-24  9:46 UTC (permalink / raw)
  To: Andrew Morton, Liu, ShuoX
  Cc: linux-kernel, Brown, Len, Andrew J. Schorr, Deepthi Dharwar

Andrew,

You are right. It's just to reuse current functions, which show 64bit usage/time. Should we add 2 new macros to define new functions for int?

Yanmin

-----Original Message-----
From: Andrew Morton [mailto:akpm@linux-foundation.org] 
Sent: Saturday, June 23, 2012 7:10 AM
To: Liu, ShuoX
Cc: linux-kernel@vger.kernel.org; Brown, Len; Zhang, Yanmin; Andrew J. Schorr; Deepthi Dharwar
Subject: Re: [PATCH] cpuidle: move field disable from per-driver to per-cpu

On Thu, 14 Jun 2012 10:52:48 +0800
ShuoX Liu <shuox.liu@intel.com> wrote:

> From: ShuoX Liu <shuox.liu@intel.com>
> 
> Andrew J.Schorr raises a question. When he changes the disable setting 
> on a single CPU, it affects all the other CPUs. Basically, currently, 
> the disable field is per-driver instead of per-cpu. All the C states 
> of the same driver are shared by all CPU in the same machine.
> 
> Below patch changes field disable to per-cpu, so we could set this 
> separately for each cpu.
> 
> ...
>
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -34,6 +34,7 @@ struct cpuidle_driver;  struct cpuidle_state_usage {
>  	void		*driver_data;
>  
> +	unsigned long long	disable;

hrmpf.  We're using 64 bits for this where one bit would do, afaict because the magic macros in drivers/cpuidle/sysfs.c are using %llu.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-24  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-14  2:52 [PATCH] cpuidle: move field disable from per-driver to per-cpu ShuoX Liu
2012-06-14 14:41 ` Andrew J. Schorr
2012-06-15 12:08 ` Deepthi Dharwar
2012-06-18  6:42   ` Yanmin Zhang
2012-06-22 23:10 ` Andrew Morton
2012-06-24  9:46   ` Zhang, Yanmin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.