linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: toddpoynor@google.com (Todd Poynor)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: Call idle notifiers
Date: Wed, 13 Jul 2011 15:53:07 -0700	[thread overview]
Message-ID: <20110713225307.GA17946@google.com> (raw)
In-Reply-To: <20110711195000.GH4109@somewhere.redhat.com>

On Mon, Jul 11, 2011 at 09:50:04PM +0200, Frederic Weisbecker wrote:
> On Mon, Jun 27, 2011 at 07:46:29PM -0700, Todd Poynor wrote:
> > Change-Id: Id833e61c13baa1783705ac9e9046d1f0cc90c95e
> > Signed-off-by: Todd Poynor <toddpoynor@google.com>
> > ---
> >  arch/arm/kernel/process.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
> > index 5e1e541..1b9101e 100644
> > --- a/arch/arm/kernel/process.c
> > +++ b/arch/arm/kernel/process.c
> > @@ -184,6 +184,7 @@ void cpu_idle(void)
> >  	while (1) {
> >  		tick_nohz_stop_sched_tick(1);
> >  		leds_event(led_idle_start);
> > +		idle_notifier_call_chain(IDLE_START);
> >  		while (!need_resched()) {
> >  #ifdef CONFIG_HOTPLUG_CPU
> >  			if (cpu_is_offline(smp_processor_id()))
> > @@ -208,6 +209,7 @@ void cpu_idle(void)
> >  			}
> >  		}
> >  		leds_event(led_idle_end);
> > +		idle_notifier_call_chain(IDLE_END);
> >  		tick_nohz_restart_sched_tick();
> >  		preempt_enable_no_resched();
> >  		schedule();
> 
> You seem to use this notifier with different semantics than x86.
> x86 notifies idle state when it knows it goes to sleep and exit it any
> time it gets interrupted. And it does that every time in the need_resched()
> loop.
> 
> But here in ARM you enter idle only once before the loop (and you don't even
> know if you will enter the loop). And you don't notify idle exit state on interrupts.
> 
> So if in the end this idle notifier is something that is really wanted, it needs
> to have a consistant behaviour across archs.

Yes, I didn't want to change the behavior of the existing notifiers
being converted in these patches, but eventually one would want
cross-arch idle callbacks with consistent behavior, and the
existing arch-specific notifications have different semantics.
My goal is to notify when the OS scheduler enters and exits its idle
loop, so the existing ARM semantics are what I'm aiming for; the x86_64
behavior is probably further evidence that it is really a
cpuidle-style operation being performed.  If the idle notifiers do
find any traction then it sounds like moving the notification to the
common schedule code would be the right thing to do.


Thanks -- Todd

  reply	other threads:[~2011-07-13 22:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28  2:46 [PATCH 0/3] Add generic idle notifiers Todd Poynor
2011-06-28  2:46 ` [PATCH 1/3] Move x86_64 idle notifiers to generic Todd Poynor
2011-06-28  2:46 ` [PATCH 2/3] ARM: Call idle notifiers Todd Poynor
2011-07-07 17:08   ` Kevin Hilman
2011-07-11 19:50   ` Frederic Weisbecker
2011-07-13 22:53     ` Todd Poynor [this message]
2011-06-28  2:46 ` [PATCH 3/3] ARM: Move leds idle start/stop calls to " Todd Poynor
2011-06-28  9:02 ` [PATCH 0/3] Add generic " Bryan Wu
2011-06-28 18:28   ` Nicolas Pitre
2011-06-28 18:25 ` Nicolas Pitre
2011-07-07 17:05 ` Kevin Hilman
2011-07-07 20:17   ` Todd Poynor
2011-07-07 22:34     ` Kevin Hilman
2011-07-08 11:13     ` Russell King - ARM Linux
2011-07-11 22:10       ` Todd Poynor

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=20110713225307.GA17946@google.com \
    --to=toddpoynor@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).