Thread (47 messages) flat view 47 messages, 6 authors, 2019-03-27

Re: [PATCH 07/32] timens/kernel: Take into account timens clock offsets in clock_nanosleep

From: Thomas Gleixner <hidden>
Date: 2019-02-08 07:56:48
Also in: lkml

On Wed, 6 Feb 2019, Dmitry Safonov wrote:
quoted hunk ↗ jump to hunk
 
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help