lkml.org 
[lkml]   [2019]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 07/32] timens/kernel: Take into account timens clock offsets in clock_nanosleep
On Wed, 6 Feb 2019, Dmitry Safonov wrote:
>
> @@ -1721,9 +1722,16 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp,
> {
> struct restart_block *restart;
> struct hrtimer_sleeper t;
> + struct timespec64 tp;
> int ret = 0;
> u64 slack;
>
> + if (!(mode & HRTIMER_MODE_REL)) {
> + tp = *rqtp;
> + rqtp = &tp;

So every invocation of hrtimer_nanosleep() gains a copy of the timespec64
even if the namespace muck is disabled.

The only relevant caller of this is common_nsleep(). So it might make sense
to have common_nsleep() separated for CLOCK_MONOTONIC/BOOTTIME and handle
the thing there. That again avoids the switch() to and out of line calls.

Thanks,

tglx


\
 
 \ /
  Last update: 2019-02-08 08:57    [W:0.192 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site