Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Tue, 8 Apr 2014 20:56:13 +0200 Frederic Weisbecker wrote: > So it may indeed be a better idea to first create a standalone > jiffies_to_nsecs(). > It can then be used to deprecate and replace most (if not all) calls to > jiffies_to_usecs() > altogether. Just the conversion must be made one

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Frederic Weisbecker
On Tue, Apr 08, 2014 at 02:15:43PM -0400, Steven Rostedt wrote: > On Tue, 8 Apr 2014 19:49:51 +0200 > Frederic Weisbecker wrote: > > > On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: > > > On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck wrote: > > > > > > > c) If not this ... then what?

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Tue, 8 Apr 2014 19:49:51 +0200 Frederic Weisbecker wrote: > On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: > > On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck wrote: > > > > > c) If not this ... then what? Separate routine to convert large numbers > > >of jiffies to usec/nsecs?

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Frederic Weisbecker
On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: > On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck wrote: > > > c) If not this ... then what? Separate routine to convert large numbers > >of jiffies to usec/nsecs? Should we make the existing one barf when > >handed a number that

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Mon, 7 Apr 2014 22:34:51 -0700 Tony Luck wrote: > On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck wrote: > > > c) If not this ... then what? Separate routine to convert large numbers > >of jiffies to usec/nsecs? Should we make the existing one barf when > >handed a number that overflows?

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Mon, 7 Apr 2014 22:34:51 -0700 Tony Luck tony.l...@gmail.com wrote: On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck tony.l...@intel.com wrote: c) If not this ... then what? Separate routine to convert large numbers of jiffies to usec/nsecs? Should we make the existing one barf when

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Frederic Weisbecker
On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck tony.l...@intel.com wrote: c) If not this ... then what? Separate routine to convert large numbers of jiffies to usec/nsecs? Should we make the existing one barf when handed a

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Tue, 8 Apr 2014 19:49:51 +0200 Frederic Weisbecker fweis...@gmail.com wrote: On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck tony.l...@intel.com wrote: c) If not this ... then what? Separate routine to convert large numbers of

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Frederic Weisbecker
On Tue, Apr 08, 2014 at 02:15:43PM -0400, Steven Rostedt wrote: On Tue, 8 Apr 2014 19:49:51 +0200 Frederic Weisbecker fweis...@gmail.com wrote: On Mon, Apr 07, 2014 at 10:34:51PM -0700, Tony Luck wrote: On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck tony.l...@intel.com wrote: c) If not

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-08 Thread Steven Rostedt
On Tue, 8 Apr 2014 20:56:13 +0200 Frederic Weisbecker fweis...@gmail.com wrote: So it may indeed be a better idea to first create a standalone jiffies_to_nsecs(). It can then be used to deprecate and replace most (if not all) calls to jiffies_to_usecs() altogether. Just the conversion

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-07 Thread Tony Luck
On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck wrote: > c) If not this ... then what? Separate routine to convert large numbers >of jiffies to usec/nsecs? Should we make the existing one barf when >handed a number that overflows? Having thought about this a bit more - I'm leaning towards

[RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-07 Thread Tony Luck
jiffies_to_usecs() returns an "int" so it can only handle times up to 2^32 microseconds (1 hour 11 minutes 34 seconds) before truncation occurs. This is a problem for the "uptime" trace clock added in commit 8aacf017b065a805d27467843490c976835eb4a5 tracing: Add "uptime" trace clock that

[RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-07 Thread Tony Luck
jiffies_to_usecs() returns an int so it can only handle times up to 2^32 microseconds (1 hour 11 minutes 34 seconds) before truncation occurs. This is a problem for the uptime trace clock added in commit 8aacf017b065a805d27467843490c976835eb4a5 tracing: Add uptime trace clock that uses

Re: [RFC PATCH] time: Fix truncation in jiffies_to_usecs()

2014-04-07 Thread Tony Luck
On Mon, Apr 7, 2014 at 3:25 PM, Tony Luck tony.l...@intel.com wrote: c) If not this ... then what? Separate routine to convert large numbers of jiffies to usec/nsecs? Should we make the existing one barf when handed a number that overflows? Having thought about this a bit more - I'm