public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Pavel Machek <pavel@ucw.cz>,
	kernel list <linux-kernel@vger.kernel.org>,
	tony@atomide.com, tuukka.tikkanen@elektrobit.com
Subject: Re: [PATCH] dyn-tick3 tweaks
Date: Fri, 5 Aug 2005 11:39:24 +1000	[thread overview]
Message-ID: <200508051139.25024.kernel@kolivas.org> (raw)
In-Reply-To: <42F2B86D.8040701@yahoo.com.au>

On Fri, 5 Aug 2005 10:53 am, Nick Piggin wrote:
> Con Kolivas wrote:
> > Something like this on top is cleaner and quieter. I'll add this to
> > pending changes for another version.
> >
> >
> > ------------------------------------------------------------------------
> >
> > Index: linux-2.6.13-rc5-ck2/arch/i386/kernel/timers/timer_tsc.c
> > ===================================================================
> > ---
> > linux-2.6.13-rc5-ck2.orig/arch/i386/kernel/timers/timer_tsc.c	2005-08-03
> > 11:29:29.000000000 +1000 +++
> > linux-2.6.13-rc5-ck2/arch/i386/kernel/timers/timer_tsc.c	2005-08-05
> > 10:22:25.000000000 +1000 @@ -167,10 +167,20 @@ static void
> > delay_tsc(unsigned long loop
> >  	} while ((now-bclock) < loops);
> >  }
> >
> > +/* update the monotonic base value */
> > +static inline void update_monotonic_base(unsigned long long last_offset)
> > +{
> > +	unsigned long long this_offset;
> > +
> > +	this_offset = ((unsigned long long)last_tsc_high << 32) | last_tsc_low;
> > +	monotonic_base += cycles_2_ns(this_offset - last_offset);
> > +	write_sequnlock(&monotonic_lock);
> > +}
> > +
>
> All else being equal, it is much better if you unlock in the
> same function that takes the lock. For readability.
>
> It looks like you should be able to leave all the flow control
> and locking the same, and use update_monotonic_base() to
> do the actual update?

Good advice, thanks. Will respin.

Cheers,
Con

  reply	other threads:[~2005-08-05  1:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 12:25 [PATCH] no-idle-hz aka dynamic ticks Con Kolivas
2005-08-02 12:58 ` Prakash Punnoor
2005-08-02 13:00   ` Con Kolivas
2005-08-02 13:28   ` [PATCH] no-idle-hz aka dynamic ticks-2 Con Kolivas
2005-08-03 21:09     ` Pavel Machek
2005-08-05  0:02       ` Con Kolivas
2005-08-05  0:05         ` Con Kolivas
2005-08-05  0:23           ` [PATCH] dyn-tick3 tweaks Con Kolivas
2005-08-05  0:53             ` Nick Piggin
2005-08-05  1:39               ` Con Kolivas [this message]
2005-08-05  3:20                 ` [PATCH] dyn-tick3 tweaks respin Con Kolivas
2005-08-05  3:32                   ` Nick Piggin
2005-08-03 21:12     ` [PATCH] no-idle-hz aka dynamic ticks-2 Pavel Machek
2005-08-04 21:20       ` Con Kolivas
2005-08-03 21:27     ` Pavel Machek
2005-08-03  7:59 ` [PATCH] no-idle-hz aka dynamic ticks Russell King
2005-08-03  9:06   ` Tony Lindgren

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=200508051139.25024.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pavel@ucw.cz \
    --cc=tony@atomide.com \
    --cc=tuukka.tikkanen@elektrobit.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