Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCH v8 1/2] timekeeping: Added a function to return tv_sec portion of ktime_get_ts64() | Date | Wed, 29 Oct 2014 11:47:12 +0100 |
| |
On Wednesday 29 October 2014 16:01:16 Heena Sirwani wrote: > The following patch adds a function to return tv_sec portion of > ktime_get_ts64() function in order to have a function that returns > seconds as 64-bit integers instead of 32-bit integers to address the > y2038 problem. > > Since we are interested only in the seconds portion of ktime_get_ts64() > and require this to be as fast as possible, we take the implementation > of ktime_get_ts64() as it is and remove everything pertaining to the > nanoseconds portion. We only add to the seconds calculation if the > calculation of nanoseconds is more than one billion nanoseconds. For all > this calculation, we add a new field to the timekeeper struct, > ktime_sec. We update this field in the function tk_update_ktime_data() > by including the calculation of monotonic clock time in seconds and > including the tk_xtime() implementation that gives the nanoseconds value > of last timer click instead of using timekeeping_get_ns() which is > expensive and we do not require such fine resolution for nanoseconds. > > Signed-off-by: Heena Sirwani <heenasirwani@gmail.com> >
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
| |