public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Daniel Walker <dwalker@mvista.com>
Cc: Eric Dumazet <dada1@cosmosbay.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] time : SMP friendly alignment of struct clocksource
Date: Tue, 20 Mar 2007 11:38:01 -0700	[thread overview]
Message-ID: <1174415881.17430.21.camel@localhost> (raw)
In-Reply-To: <1174413862.3101.185.camel@imap.mvista.com>

On Tue, 2007-03-20 at 11:04 -0700, Daniel Walker wrote:
> On Tue, 2007-03-20 at 10:58 -0700, john stultz wrote:
> 
> > >  	/* timekeeping specific data, ignore */
> > > -	cycle_t cycle_last, cycle_interval;
> > > -	u64 xtime_nsec, xtime_interval;
> > > +	cycle_t cycle_interval;
> > > +	u64	xtime_interval;
> > > +	/*
> > > +	 * Second part is written at each timer interrupt
> > > +	 * Keep it in a different cache line to dirty no
> > > +	 * more than one cache line.
> > > +	 */
> > > +	cycle_t cycle_last ____cacheline_aligned_in_smp;
> > > +	u64 xtime_nsec;
> > >  	s64 error;
> 
> What was the motivation for having these (cycle_last for example) in the
> clocksource structure. I recall them being added in there at one point,
> but I'm not sure why.. Specifically the ones that are updated often.

Roman claimed it produced better code, and the values are functionally
clocksource specific (meaning if the clocksource changed, and they were
global, you would have to reset them anyway).

I think logically those values are more timekeeping oriented then
clocksource oriented, but one could argue that since we manipulate
clocksource.mult in the timekeeping's NTP code, mult is timekeeping
specific as well.

If you really wanted a clean design, you'd probably have to keep all of
those values as a timekeeping_clocksource struct, and then have smaller
clocksource structs (name, mult, shift, read) that is filled in by the
clocksource driver and copied over on clocksource changes. That way the
timekeeping code wouldn't manipulate the clocksource structure directly.

But really, it seems like work for little to no reward (plus opens the
issue of "but i want a ntp frequency adjusted sched_clock!" which would
not be possible).

-john


      reply	other threads:[~2007-03-20 18:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20 10:09 [PATCH] time : SMP friendly alignment of struct clocksource Eric Dumazet
2007-03-20 17:58 ` john stultz
2007-03-20 18:04   ` Daniel Walker
2007-03-20 18:38     ` john stultz [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=1174415881.17430.21.camel@localhost \
    --to=johnstul@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dada1@cosmosbay.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.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