public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: suresh.b.siddha@intel.com, santosh.shilimkar@ti.com,
	linux-kernel@vger.kernel.org, johnstul@us.ibm.com
Subject: Re: [PATCH] clockevents: Leave broadcast device shtudown only if the current device is always running.
Date: Thu, 12 Apr 2012 00:04:02 +0800	[thread overview]
Message-ID: <20120411160402.GA27044@feng-i7> (raw)
In-Reply-To: <alpine.LFD.2.02.1204111208070.2542@ionos>

Hi Thomas,

On Wed, Apr 11, 2012 at 12:10:59PM +0200, Thomas Gleixner wrote:
> On Wed, 11 Apr 2012, Feng Tang wrote:
> > > Problem you encountered is not related to leaving the broadcast device
> > > in shutdown mode. Problem is that we didn't track the mode change to
> > > oneshot and later during idle entry/exit, when we request the broadcast
> > > device services using CLOCK_EVT_NOTIFY_BROADCAST_ENTER etc,
> > > tick_broadcast_oneshot_control() returns with out doing much as it
> > > thinks broadcast device is in periodic mode.
> > 
> > Just curious, IIUC, the tick_broadcast_switch_to_oneshot() is only called
> > during CPU init process in boot time or bring a offlined cpu back on. Why
> > is it related to the deep idle?
> 
> Because a deep idle state might require the broadcast device and w/o
> Suresh's patch it can't use it because it's in the wrong state.
>

Thanks for the explaination, I understand the root cause now.

And regarding the original commit 77b0d60c5
    clockevents: Leave the broadcast device in shutdown mode when not needed

@@ -575,11 +575,15 @@ void tick_broadcast_switch_to_oneshot(void)
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
+	if (cpumask_empty(tick_get_broadcast_mask()))
+		goto end;

  	tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
 	bc = tick_broadcast_device.evtdev;
 	if (bc)
 		tick_broadcast_setup_oneshot(bc);
+
+end:
 	raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
 }
 
The tick_broadcast_switch_to_oneshot() get called mostly at boot time or
during cpu hotplug. And when it is called at boot time, the tick_broadcast_mask
is alwasys 0 at the point, thus this check is always true and skip the
following oneshot setting up for broadcast device, which sounds a little
buggy.

Thanks,
Feng

> 
> Thanks,
> 
> 	tglx

  reply	other threads:[~2012-04-11 16:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09  6:03 [PATCH] clockevents: Leave broadcast device shtudown only if the current device is always running Santosh Shilimkar
2012-04-09 22:41 ` Suresh Siddha
2012-04-10  6:56   ` Shilimkar, Santosh
2012-04-10  9:49   ` [tip:timers/urgent] clockevents: tTack broadcast device mode change in tick_broadcast_switch_to_oneshot() tip-bot for Suresh Siddha
2012-04-12  1:27     ` Alex Shi
2012-04-12  4:35       ` Suresh Siddha
2012-04-12  5:10         ` Alex Shi
     [not found]   ` <CA++bM2th5XW1gxrHbcHwDK=qBBaNc3ut0ydbNNStfNa-Xa-9tA@mail.gmail.com>
2012-04-11  6:34     ` [PATCH] clockevents: Leave broadcast device shtudown only if the current device is always running Feng Tang
2012-04-11 10:10       ` Thomas Gleixner
2012-04-11 16:04         ` Feng Tang [this message]
2012-04-11 21:01           ` Suresh Siddha
2012-04-15 12:57   ` Santosh Shilimkar
2012-04-16 22:03     ` Suresh Siddha
2012-04-17  8:14       ` Santosh Shilimkar
2012-04-17 19:11         ` Suresh Siddha
2012-04-18  5:41           ` Shilimkar, Santosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120411160402.GA27044@feng-i7 \
    --to=feng.tang@intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox