public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Fwd: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.]
@ 2011-12-26  1:28 Yanmin Zhang
  2011-12-28  0:10 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Yanmin Zhang @ 2011-12-26  1:28 UTC (permalink / raw)
  To: akpm; +Cc: LKML, shaohua.li, len.brown, mingmingx.zhang

Andrew,

Would you like to accept the patch into your testing tree?

Thanks,
Yanmin

-------- Forwarded Message --------
From: Zhang, MingmingX <mingmingx.zhang@intel.com>
To: linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Cc: yanmin_zhang@linux.intel.com <yanmin_zhang@linux.intel.com>, Li,
Shaohua <shaohua.li@intel.com>, Brown, Len <len.brown@intel.com>
Subject: [patch] intel_idle: Delete meaningless local_irq_disable() call
in intel_idle.c.
Date: Fri, 23 Dec 2011 01:57:29 +0000

From: mzha38X <mingmingx.zhang@intel.com>

intel_idle.c is a bit misleading in a sense that local_irq_disable,it
actually does nothing. Real irq disable happens earlier in process_32.c:cpu_idle.
Basically, cpuidle_state->enter is called, cpu irq is disabled.
cpuidle_state->enter would turn on irq when exiting.

intel_idle doesn't follow this assumption. Although it doesn't
cause real issue, it misleads developers. Below patch deletes
the calling to local_irq_disable() at entry.

Signed-off-by: mzha38X <mingmingx.zhang@intel.com>
---
 drivers/idle/intel_idle.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 5d2f8e1..28f0394 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -247,8 +247,6 @@ static int intel_idle(struct cpuidle_device *dev,
 
 	cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
 
-	local_irq_disable();
-
 	/*
 	 * leave_mm() to avoid costly and often unnecessary wakeups
 	 * for flushing the user TLB's associated with the active mm.
-- 
1.7.1



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

* Re: [Fwd: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.]
  2011-12-26  1:28 [Fwd: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.] Yanmin Zhang
@ 2011-12-28  0:10 ` Andrew Morton
  2011-12-28  0:27   ` Yanmin Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-12-28  0:10 UTC (permalink / raw)
  To: yanmin_zhang; +Cc: LKML, shaohua.li, len.brown, mingmingx.zhang

On Mon, 26 Dec 2011 09:28:20 +0800
Yanmin Zhang <yanmin_zhang@linux.intel.com> wrote:

> Andrew,
> 
> Would you like to accept the patch into your testing tree?

hm, that's three indel_idle patches which I have now.  Someone wake up
lenb!

> intel_idle.c is a bit misleading in a sense that local_irq_disable,it
> actually does nothing. Real irq disable happens earlier in process_32.c:cpu_idle.
> Basically, cpuidle_state->enter is called, cpu irq is disabled.
> cpuidle_state->enter would turn on irq when exiting.
> 
> intel_idle doesn't follow this assumption. Although it doesn't
> cause real issue, it misleads developers. Below patch deletes
> the calling to local_irq_disable() at entry.
> 
> Signed-off-by: mzha38X <mingmingx.zhang@intel.com>
> ---
>  drivers/idle/intel_idle.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index 5d2f8e1..28f0394 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -247,8 +247,6 @@ static int intel_idle(struct cpuidle_device *dev,
>  
>  	cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
>  
> -	local_irq_disable();
> -
>  	/*
>  	 * leave_mm() to avoid costly and often unnecessary wakeups
>  	 * for flushing the user TLB's associated with the active mm.

I'd suggest adding this as well:

--- a/drivers/idle/intel_idle.c~drivers-idle-intel_idlec-remove-redundant-local_irq_disable-call-fix
+++ a/drivers/idle/intel_idle.c
@@ -232,6 +232,7 @@ static int get_driver_data(int cstate)
  * @drv: cpuidle driver
  * @index: index of cpuidle state
  *
+ * Must be called under local_irq_disable().
  */
 static int intel_idle(struct cpuidle_device *dev,
 		struct cpuidle_driver *drv, int index)
_


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

* Re: [Fwd: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.]
  2011-12-28  0:10 ` Andrew Morton
@ 2011-12-28  0:27   ` Yanmin Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Yanmin Zhang @ 2011-12-28  0:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, shaohua.li, len.brown, mingmingx.zhang

On Tue, 2011-12-27 at 16:10 -0800, Andrew Morton wrote:
> On Mon, 26 Dec 2011 09:28:20 +0800
> Yanmin Zhang <yanmin_zhang@linux.intel.com> wrote:
> 
> > Andrew,
> > 
> > Would you like to accept the patch into your testing tree?
> 
> hm, that's three indel_idle patches which I have now.  Someone wake up
> lenb!
> 
> > intel_idle.c is a bit misleading in a sense that local_irq_disable,it
> 

> I'd suggest adding this as well:
Agree. It'll be clearer.

> 
> --- a/drivers/idle/intel_idle.c~drivers-idle-intel_idlec-remove-redundant-local_irq_disable-call-fix
> +++ a/drivers/idle/intel_idle.c
> @@ -232,6 +232,7 @@ static int get_driver_data(int cstate)
>   * @drv: cpuidle driver
>   * @index: index of cpuidle state
>   *
> + * Must be called under local_irq_disable().
>   */
>  static int intel_idle(struct cpuidle_device *dev,
>  		struct cpuidle_driver *drv, int index)



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

end of thread, other threads:[~2011-12-28  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-26  1:28 [Fwd: [patch] intel_idle: Delete meaningless local_irq_disable() call in intel_idle.c.] Yanmin Zhang
2011-12-28  0:10 ` Andrew Morton
2011-12-28  0:27   ` Yanmin Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox