Re: [PATCH v8 1/2] timekeeping: Added a function to return tv_sec portion of ktime_get_ts64()

From: Arnd Bergmann
Date: Wed Oct 29 2014 - 06:47:22 EST


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@xxxxxxxxx>
>

Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/