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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux