mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ashwin Chaugule <ashwinc@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com
Subject: Re: [RFC] [PATCH 1/1] hrtimers: Cache next hrtimer
Date: Mon, 31 Aug 2009 09:08:26 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0908310854020.19335@localhost.localdomain> (raw)
In-Reply-To: <4A9B4ECB.7070506@codeaurora.org>

On Mon, 31 Aug 2009, Ashwin Chaugule wrote:
> Thomas Gleixner wrote:
> 
> >   That's not hard to fix by allowing the reprogramming to skip when the
> > new expiry time is the same as the old one.
> > 
> > I think that allowing the reprogram to skip is catching more cases
> > than the cached pointer. If the cached pointer is the one which gets
> > removed we might still reprogram with the same expiry value.
> >   
> Um. Wouldn't the cached pointer point to the first (oldest) hrtimer in the
> series of timers with the same expires value ? Then it would be the last
> hrtimer to be removed. I'm walking through the rbtree now to confirm this.
> 
> > Can you please try the delta patch on top of the last one I sent ?
> >   
> This looks very good ! Our results are almost similar now. However, I think
> that with this new
> patch we're still arming the timer needlessly at least once. This is the
> case when we're trying to remove the first (oldest) hrtimer with
> timer->expires = cpu->expires_next, but we forgo the reprogramming, when we
> really shouldn't. At this point, with the current scheme of things, we will
> needlessly wakeup and simply correct the expires_next value by
> traversing up the rbtree, to the parent node.

That only happens, when that timer is the last one in both trees. Then
the resulting reprogramming value is KTIME_MAX and we skip the
reprogramming. That's easy to fix by removing the KTIME_MAX check.
 
> If we knew in advance that this to-be-removed timer, was the oldest hrtimer
> of the series, then we could force reprogram, such that we wake up only when
> the parent node timer is really going to expire. This may make a noticeable
> difference in power for some devices. 
>
> Another question is, what happens when base->first of REALTIME and MONOTONIC
> both have the same expires ?

The skip_equal check covers both. We find out which timer of the two
bases is expiring next and compare the result against
cpu_base->expires_next. If both are identical we skip.

Thanks,

	tglx


  reply	other threads:[~2009-08-31  7:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 21:51 Ashwin Chaugule
2009-08-27 21:56 ` Ashwin Chaugule
2009-08-27 22:51   ` Thomas Gleixner
2009-08-27 23:09     ` Ashwin Chaugule
2009-08-27 23:16       ` Thomas Gleixner
2009-08-28  5:56         ` Ashwin Chaugule
2009-08-28 11:17           ` Thomas Gleixner
2009-08-28 16:34             ` Ashwin Chaugule
2009-08-28 18:19               ` Thomas Gleixner
2009-08-28 20:27                 ` Ashwin Chaugule
2009-08-30  6:06                 ` Ashwin Chaugule
2009-08-30  8:36                   ` Thomas Gleixner
2009-08-31  4:17                     ` Ashwin Chaugule
2009-08-31  7:08                       ` Thomas Gleixner [this message]
2009-09-01  3:13                         ` Ashwin Chaugule
2009-09-03 17:48                         ` Ashwin Chaugule
2009-09-15  9:09                           ` [tip:timers/core] hrtimer: Eliminate needless reprogramming of clock events device tip-bot for Ashwin Chaugule
2009-09-15 15:19                           ` tip-bot for Ashwin Chaugule

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.LFD.2.00.0908310854020.19335@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=ashwinc@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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®