mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Alex Zeffertt <Alex.Zeffertt@eu.citrix.com>,
	"stable@kernel.org" <stable@kernel.org>
Subject: Re: [PATCH] clockevent: on resume program the next oneshot tick with the next actual event
Date: Thu, 26 Mar 2009 13:37:40 +0000	[thread overview]
Message-ID: <1238074660.3691.232.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <49CAC0D6.3040301@goop.org>

On Wed, 2009-03-25 at 19:40 -0400, Jeremy Fitzhardinge wrote:
> Ian Campbell wrote:
> > Hmm, yes I think so too. I misread tick_dev_program_event(), it seems
> > like it Does The Right Thing and I do see the Xen set_next_event hook
> > get called which I thought wasn't getting called earlier.
> >
> > Turns out the virtual timer IRQ isn't getting reinitialised before
> > tick_oneshot_resume runs so we are just missing the interrupt, doh!
> >   
> 
> While that ordering is a bug, I'm still not sure it completely explains 
> what we're seeing here.
> 
> In drivers/xen/manage.c:do_suspend() we call clock_was_set(), which has 
> the specific effect of causing all the timer events to get retriggered 
> on all cpus.

Not if CONFIG_HIGH_RES_TIMERS is not set, which I don't have. If I set
it then things work as expected even without the patch.

When CONFIG_HIGH_RES_TIMERS is set though the call to clock_was_set ends
up in hr_timer_force_reprogram, I'm not clear what the relationship
between hrtimers and ticks is, they both seem to call down to the
oneshot code eventually, so they must coexist somehow...

Ian.

>   This is necessary because we don't unplug/replug all the 
> cpus, and the normal sysdev_resume() timer resume only resumes the 
> current cpu (which is cpu 0 in this case).  It also deals with the 
> clocksource timebase shifting, as it will over suspend/resume (esp 
> suspend/reboot/resume, or suspend/migrate/resume).  Your patch will only 
> re-trigger the next cpu0 timer event, and leave the rest hanging without 
> a next event.
> 
> So the question is why does your patch help?
> 
> I'm seeing much worse symptoms on my test machine: the resumed domain is 
> just sitting there spinning dead with 100% cpu use.  I don't know if 
> this is related or something else.
> 
>     J
> 
> > Subject: xen: resume interrupts before system devices.
> >
> > otherwise the first timer interrupt after resume is missed and we never
> > get another.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> >
> > diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> > index 0489ea2..5269bb4 100644
> > --- a/drivers/xen/manage.c
> > +++ b/drivers/xen/manage.c
> > @@ -68,15 +68,15 @@ static int xen_suspend(void *data)
> >  	gnttab_resume();
> >  	xen_mm_unpin_all();
> >  
> > -	sysdev_resume();
> > -	device_power_up(PMSG_RESUME);
> > -
> >  	if (!*cancelled) {
> >  		xen_irq_resume();
> >  		xen_console_resume();
> >  		xen_timer_resume();
> >  	}
> >  
> > +	sysdev_resume();
> > +	device_power_up(PMSG_RESUME);
> > +
> >  	return 0;
> >  }
> >  
> >
> > Ian.
> >
> >
> >
> >   
> >>     J
> >> --
> >> 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/
> >>
> >>     
> >
> >   
> 


      reply	other threads:[~2009-03-26 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25 13:40 Ian Campbell
2009-03-25 17:19 ` Jeremy Fitzhardinge
2009-03-25 17:46   ` Ian Campbell
2009-03-25 23:40     ` Jeremy Fitzhardinge
2009-03-26 13:37       ` Ian Campbell [this message]

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=1238074660.3691.232.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@eu.citrix.com \
    --cc=Alex.Zeffertt@eu.citrix.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --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

all inboxes | Powered by JetHome®