From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Cc: tglx@linutronix.de, "Rafael J. Wysocki" <rjw@sisk.pl>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Alan Stern <stern@rowland.harvard.edu>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: interrupt latency while resuming.
Date: Sat, 8 Jan 2011 17:13:32 +0000 [thread overview]
Message-ID: <20110108171332.GB31708@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4D2897D1.3040609@codeaurora.org>
On Sat, Jan 08, 2011 at 08:58:57AM -0800, Abhijeet Dharmapurikar wrote:
>
> I am trying to address an issue of not handling a wakeup interrupt quick
> enough while resuming. It is an edge triggered interrupt with the
> IRQ_WAKEUP flag set. The interrupt controller implements lazy disabling
> of interrupts, IOW does not have a disable callback in the irq_chip.
>
> So while going in to supend that interrupt is marked IRQ_DISABLED in
> dpm_suspend_noirq().
>
> On resume handle_edge_trigger is run right after
> arch_suspend_enable_irqs(). It finds the interrupt marked IRQ_DISABLED
> and it sets the IRQ_PENDING flag and does not call the handler.
>
> As the resume path unrolls, non boot cpus are enabled,
> dpm_resume_noirq() is run. At that time it finds the IRQ_PENDING flag is
> set on this interrupt and the interrupt handler is run.
The reason it's after non-boot CPUs are enabled is that the affinity
settings may require it to be run on one of these CPUs, so we need to
ensure that those CPUs are up.
We know it takes something like 200ms to run the lpg calibration, and
this is responsible for the majority of the time when bringing a CPU
online.
One solution is to sort out whether we need to re-run the lpj calibration
each time we resume a CPU. At the moment, we're just using the boot CPU
loops_per_jiffy for every udelay(), assuming that all CPUs are running
at the same clock rate - so we _could_ skip the calibration as its
never used.
Or we could fix things so that it is used (which also sorts udelay for
asymetrically clocked secondary CPUs) but then we always have to re-run
the calibration, or we have to stipulate that secondary CPUs come up at
the same clock rate as they went down. I suspect there's systems out
there where the latter is not true at present, so it's not something we
can impose - which means we're stuck having to do 200ms of recalibration
per CPU.
Another solution is to check whether we can run the handler before other
CPUs are online - it may mean we're breaking IRQ affinity, but any
non-boot affinity has already been broken by taking the other CPUs
offline.
next prev parent reply other threads:[~2011-01-08 17:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 16:58 interrupt latency while resuming Abhijeet Dharmapurikar
2011-01-08 17:13 ` Russell King - ARM Linux [this message]
2011-01-08 19:09 ` Abhijeet Dharmapurikar
2011-01-11 5:11 ` Stephen Boyd
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=20110108171332.GB31708@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=adharmap@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=stern@rowland.harvard.edu \
--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;
as well as URLs for NNTP newsgroup(s).