From: john stultz <johnstul@us.ibm.com>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>,
George Anzinger <george@mvista.com>,
Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
Subject: Re: [PATCH 1/6] new timeofday core subsystem for -mm (v.B3)
Date: Mon, 20 Jun 2005 16:55:34 -0700 [thread overview]
Message-ID: <1119311734.9947.143.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0506202231070.3728@scrub.home>
On Tue, 2005-06-21 at 00:05 +0200, Roman Zippel wrote:
> Hi,
>
> On Mon, 20 Jun 2005, john stultz wrote:
>
> > > I see lots of new u64 variables. I'm especially interested how this code
> > > scales down to small and slow machines, where such a precision is absolute
> > > overkill. How do these patches change current and possibly common time
> > > operations?
> >
> >
> > Hey Roman,
> > That's a good issue to bring up. With regards to the timeofday
> > infrastructure, there are two performance concerns (though let me know
> > if I'm forgetting something):
>
> You don't really answer the core question, why do you change everything to
> nanoseconds and 64bit values?
Well, for a reasonable range of timesource frequencies and interval
lengths, the cycle values needs to be 64 bits wide and the mult/shift
operation to convert cycles to time is going to need to done with 64
bits.
Since xtime is currently a timespec, we already keep nanosecond
precision using 64 bits. It was then just a question of how complicated
is it to do the manipulations with timespecs vs flat 64 bits worth of
nanoseconds. Nanoseconds made the design cleaner, so I went with them
keeping the option to optimize in the future when real issues arose.
> > On smaller systems, timer interrupt processing is a concern, with the
> > shift to HZ=1000, we got a number of complaints from folks w/ old 486s
> > where time would drift due lost ticks. This would happen when something
> > (usually IDE in PIO mode) would disable interrupts and they would miss a
> > ton of timer interrupts. Also the impact of running the timekeeping code
> > 10x more frequently was seen in a number of cases.
> >
> > With the new infrastructure, timekeeping is all done via a soft-timer
> > outside of interrupt context. In fact, the timekeeping soft-timer is
> > setup to run every 50ms instead of every ms. This should help overall
> > performance on slower systems using high HZ values.
>
> With -mm you can now choose the HZ value, so that's not really the
> problem anymore. A lot of archs even never changed to a higher HZ value.
> So now I still like to know how does the complexity change compared to the
> old code?
Well, even if it is less of a concern with lower HZ values, my code
should still reduce the interrupt overhead for those who would like to
have higher HZ values to improve latency. (Although until I have
numbers, its all just talk. :)
> > As for gettimefoday() syscall performance, I one had some numbers, but I
> > would need to re-create them. I'll see if I can grab a slower box and
> > give you some hard numbers. The gettimeofday() path is fairly
> > streamlined and should be pretty straight forward in the patch (see
> > kernel/timeofday.c), so let me know if you have specific concerns.
> >
> > There will probably be a bit of a drop, but I have some ideas for
> > cacheing a precomputed timeval in the timekeeping soft-timer if its a
> > serious issue.
>
> Well, AFAICT on slower machines (older and embedded stuff) it's a serious
> issue. The current code calculates the timeval with some simple 32bit
> calculations. Your code introduces the nsec step, which means several
> 64bit calculations and suddenly the overhead explodes on some machines.
>
> As m68k maintainer I see no reason to ever switch to your new code, which
> might leave you with the dilemma having to maintain two versions of the
> timer code. What reason could I have to switch to the new timer code?
>
> I had no problems with a little more overhead, like a _few_ more 64bit
> operations per second (and preferably add/shifts), but I'm not really
> enthusiastic about the new code. Why don't you keep the main part 32 bits
> (or long)? What's wrong with using timeval or timespec?
Well, I think the only overhead to be worried with is just in
gettimeofday(), but let me get some hard numbers to show that. I've
already implemented some optimized caching for x86-64's vsyscall-gtod
implementation, so let me also try to make an arch generic version and
see if I cannot settle your concerns.
> I like the concept of the a time source in your patch. m68k already uses a
> number of timer related callbacks into machine specific code. If I could
> replace that with a timer driver, I'd be really happy. OTOH if it requires
> several expensive conversion between different time formats, I rather keep
> the current code.
Thanks, I really appreciate your review and feedback. I very much want
this to be a solution everyone can be happy (or at least indifferent)
with.
thanks
-john
next prev parent reply other threads:[~2005-06-21 0:10 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-18 2:56 john stultz
2005-06-18 2:58 ` [PATCH 2/6] new timeofday i386 arch specific changes, part 1 " john stultz
2005-06-18 2:59 ` [PATCH 3/6] new timeofday i386 arch specific changes, part 2 " john stultz
2005-06-18 3:01 ` [PATCH 4/6] new timeofday i386 arch specific changes, part 3 " john stultz
2005-06-18 3:02 ` [PATCH 5/6] new timeofday i386 arch specific changes, part 4 " john stultz
2005-06-18 3:04 ` [PATCH 6/6] new timeofday i386 specific timesources " john stultz
2005-06-18 12:02 ` [PATCH 1/6] new timeofday core subsystem " Roman Zippel
2005-06-20 7:01 ` Ulrich Windl
2005-06-20 10:22 ` Roman Zippel
2005-06-20 10:31 ` Ulrich Windl
2005-06-20 10:54 ` Roman Zippel
2005-06-20 11:04 ` Christoph Hellwig
2005-06-20 17:09 ` john stultz
2005-06-20 18:10 ` Lee Revell
2005-06-20 21:53 ` john stultz
2005-06-20 23:44 ` Lee Revell
2005-06-21 14:55 ` Chris Friesen
2005-06-21 17:20 ` john stultz
2005-06-21 6:26 ` Ulrich Windl
2005-06-20 22:05 ` Roman Zippel
2005-06-20 23:40 ` Lee Revell
2005-06-20 23:55 ` john stultz [this message]
2005-06-21 15:08 ` Roman Zippel
2005-06-22 0:57 ` john stultz
2005-06-22 2:39 ` john stultz
2005-06-22 19:45 ` Roman Zippel
2005-06-23 0:29 ` john stultz
2005-06-23 21:59 ` Roman Zippel
2005-06-24 0:33 ` john stultz
2005-06-24 10:58 ` Roman Zippel
2005-06-21 6:42 ` Ulrich Windl
2005-06-21 15:13 ` Roman Zippel
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=1119311734.9947.143.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=akpm@osdl.org \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ulrich.windl@rz.uni-regensburg.de \
--cc=zippel@linux-m68k.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
all inboxes | Powered by JetHome®