From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v2] clockevents: re-calculate event when cpu enter idle
Date: Tue, 9 Sep 2014 12:35:32 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1409091223160.11037@nanos> (raw)
In-Reply-To: <1409793933-29938-1-git-send-email-leoy@marvell.com>
On Thu, 4 Sep 2014, Leo Yan wrote:
This changelog is pretty uncomprehensible, but I can see what you are
trying to solve.
> Below flow will have the redundant interrupts for broadcast timer:
>
> 1. Process A starts a hrtimer with 100ms timeout, then Process A will
> wait on the waitqueue to sleep;
> 2. The CPU which Process A runs on will enter idle and call notify
> CLOCK_EVT_NOTIFY_BROADCAST_ENTER, so the CPU will shutdown its local
> and set broadcast timer's next event with delta for 100ms timeout;
> 3. After 70ms later, the CPU is waken up by other peripheral's interrupt
> and Process A will be waken up as well; Process A will cancel the hrtimer
> at this point, kernel will remove the timer event from the event queue
> but it will not really disable broadcast timer;
> 4. So after 30ms later, the broadcast timer interrupt will be triggered
> even though the timer has been cancelled by s/w in step 3.
>
> To fix this issue, in theory cpu can check this situation when the cpu
> enter and exit idle; So it can iterate the related idle cpus to calculate
> the correct broadcast event value.
>
> But with upper method, it has the side effect. Due the cpu enter and exit
> idle state very frequently in short time, so can optimize to only calculate
> the correct state only when the cpu join into broadcast timer and set the
> next event after calculate a different event compare to previous time.
And you inflict this unconditionally on every invocation of broadcast
enter, if the cpu is not the one which has the first expiring timer.
What's the point of doing a full scan unconditionally just to catch an
obscure corner case like you describe above? That's just stupid and
while it might be a non issue on your quadcore ARM it's going to be a
pain on larger mostly idle machines.
So unconditially forcing the scan on everyone to deal with some corner
case is not going to happen.
Thanks,
tglx
prev parent reply other threads:[~2014-09-09 10:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 1:25 [RFC PATCH v2] clockevents: re-calculate event when cpu enter idle Leo Yan
2014-09-09 8:55 ` Leo Yan
2014-09-09 10:35 ` Thomas Gleixner [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=alpine.DEB.2.10.1409091223160.11037@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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