lkml.org 
[lkml]   [2012]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/16] math128: Introduce various 128bit primitives
On Fri, 26 Oct 2012, Peter Zijlstra wrote:
> On Fri, 2012-10-26 at 11:42 +0200, Ingo Molnar wrote:
> > * Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > > On Fri, 2012-10-26 at 11:24 +0200, Ingo Molnar wrote:
> > >
> > > > So can we control this by restricting the users and avoiding
> > > > the overflow?
> > > >
> > > > A 2^64 result should be a *huge* amount of space already for
> > > > just about anything.
> > >
> > > I _think_ something like: dl_runtime * dl_deadline < U64_MAX,
> > > might do that. The question is, is this constraint usable?
> > > Simplified that boils down to about 4 seconds each, which
> > > sounds pretty much ok for most people -- but such statements
> > > usually come back to bite you (640kb anybody...).
> >
> > We could constrain the precision, not the maximum value.
> >
> > Having a 4 seconds hard limit is one thing, only having 10 nsecs
> > precision at 40 seconds is another.
>
> That gets to be rather ugly I think.. for one it might surprise people,
> secondly you get to have a bunch of conditionals and shifts in that code
> path.
>
> Personally I'd prefer to do the simple thing, esp. for a new interface.
> So either do the hard limit or the u128 thing.
>
> If we go with the hard limit, we can always address things when people
> run into it and complain, at such a time we also have a better view of
> people's uses and expectations methinks.

By all means. nsec precision is a completly academic thought
exercise. It's really pointless to even think about anything below
microseconds resolution.

We can still have the user space interface handing in the information
in nsec resolution, but it's reasonable to scale it down to something
useful. Just shift the incoming information right by 10, so you're in
the 1us resolution for all the internal math and all your limitation
problems are gone. A shift by ten for converting back and forth to
nsecs is not a real performance issue.

Thanks,

tglx







\
 
 \ /
  Last update: 2012-10-26 13:21    [W:0.253 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site