All of lore.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "mingo@elte.hu" <mingo@elte.hu>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	<shaohua.li@intel.com>, <jacob.jun.pan@intel.com>
Subject: Re: [PATCH] tick: add check for the existence of broadcast clock event device
Date: Mon, 8 Jun 2009 09:57:30 +0800	[thread overview]
Message-ID: <20090608095730.0c945e78@feng-desktop> (raw)
In-Reply-To: <alpine.LFD.2.00.0906061815460.3419@localhost.localdomain>

On Sun, 7 Jun 2009 00:18:55 +0800
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Sat, 6 Jun 2009, Thomas Gleixner wrote:
> > Feng,
> > 
> > On Sat, 6 Jun 2009, Feng Tang wrote:
> > > > If your percpu devices are always on (not affected by C3 stop)
> > > > then you never dereference bc. So why do we need an extra check
> > > > for !bc ?
> > > 
> > > Hi tglx,
> > 
> > > Thanks for the explanation. But we really ran into the NULL
> > > pointer case, in our platform, there are 2 X86 CPUs which have
> > > lapic, also it has 2 external timers which are pretty similar
> > > with HPET timers, those 2 external timers will be used as per-cpu
> > > timers (higher rating than lapic timer). In system's power cycle
> > > of suspend and resume, disable_nontboot_cpus will be called
> > > before goto suspend state,and enable_nonboot_cpus will be called
> > > for the resume process, so lapic timer of cpu1 will be first
> > > registered as per-cpu timer, and our external timer will be
> > > registered later after get a CPU_ONLINE notifier (similar with
> > > HPET), right in this time slot that lapic is the per-cpu timer,
> > > when system get the CLOCK_EVT_BROADCAST_ENTER/EXIT msg,
> > > tick_do_broadcast_on_off() is called and hit the NULL pointer
> > > case.
> > 
> > Ok, I can understand now why we need it. I'll apply your patch and
> > add some more info into the commit msg so we do not look at it in a
> > year and scratch our heads. :)
> 
> Hmm, thought more about it.
> 
> 1) How do you calibrate the local APIC timer if you do not have some
> initial timer device ?
Yes, we have external timer device with the name "apbt"
> 
> 2) If you have some initial timer device (PIT/HPET) why isn't it
> registered as broadcast device.
We only have 2 available apbt, apbt0 for cpu0 and apbt1 for cpu1. And based on my understanding, there is no explicit API to register a timer as bc, and bc is setup during clockevents_register_device() --> tick_check_new_device() -->tick_check_broadcast_device(), and HPET case can just meet the condition: lapic's rating is 110, timer "hpet"is 50 and set to be the broadcast device, and other hpet(2/3/4/5..)'s are 150 and set to be the per-cpu timer

> 
> 3) When the CPU uses the local APIC before the external timer is
> initialized what happens if the system goes into a deeper c-state ?
Good point, for cpu1, this is not an issue, as cpu0 will register apbt1 for cpu1. there is a window cpu1 is in deep c-idle state and no timer wake it up, but window is small as cpu0 will send IPI soon.
>  
> Thanks,
> 
> 	tglx

  reply	other threads:[~2009-06-08  1:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05  3:27 [PATCH] tick: add check for the existence of broadcast clock event device Feng Tang
2009-06-06  9:24 ` Thomas Gleixner
2009-06-06 12:47   ` Feng Tang
2009-06-06 12:54     ` Thomas Gleixner
2009-06-06 16:18       ` Thomas Gleixner
2009-06-08  1:57         ` Feng Tang [this message]
2009-06-08  5:43           ` Thomas Gleixner
2009-06-08  6:12             ` Feng Tang
2009-06-08  6:33               ` Thomas Gleixner
2009-06-08  6:47                 ` Feng Tang
2009-06-08  7:00                   ` Thomas Gleixner
2009-06-08  7:47                     ` Tang, Feng
2009-06-08 13:41                       ` Thomas Gleixner
2009-06-09  0:21                         ` Pan, Jacob jun
2009-06-09  8:18                           ` Thomas Gleixner
2009-06-09 12:49                             ` Pan, Jacob jun
2009-06-09 16:53                               ` Thomas Gleixner

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=20090608095730.0c945e78@feng-desktop \
    --to=feng.tang@intel.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=shaohua.li@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 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.