lkml.org 
[lkml]   [2016]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] cputime: Fix timeval-->cputime conversion
Date
> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Monday, February 01, 2016 4:43 PM
> To: Zengtao (B)
> Cc: Arnd Bergmann; LKML; Frederic Weisbecker
> Subject: RE: [PATCH] cputime: Fix timeval-->cputime conversion
>
> On Mon, 1 Feb 2016, Zengtao (B) wrote:
>
> > Hi Arnd:
> > I have got a new idea about the problem:
> > In include/linux/time64.h
> > #define NSEC_PER_SEC 1000000000L
> > I think we should change it to
> > #define NSEC_PER_SEC 1000000000LL
> >
> > My reason is :
> > 1. when it is used in a multiplication, it will easily get overflow.
> > 2. when it don't get overflow, the change has no side affect.
>
> That's not a good idea. NSEC_PER_SEC is used in lots of places with 32bit
> storage. I really don't want to mop up all the fallout.

Yes, agree, a lot of places it has been used as 32bit value. Beyond that, I think
it is more reasonable to use 64bit.

>
> Thanks,
>
> tglx
>

\
 
 \ /
  Last update: 2016-02-02 04:21    [W:0.046 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site