Re: [PATCHv4 07/28] posix-timers/timens: Take into account clock offsets

2019-06-16 Thread Dmitry Safonov
On 6/14/19 2:42 PM, Thomas Gleixner wrote:
> On Wed, 12 Jun 2019, Dmitry Safonov wrote:
> 
>> Subject: posix-timers/timens: Take into account clock offsets
> 
> Please avoid that '/timens' appendix. It's not really a new subsystem or
> subfunction of posix-timers.
> 
> posix-timers: Add time namespace support to common_timer_set()

Ok

> 
>> From: Andrei Vagin 
>>
>> Wire timer_settime() syscall into time namespace virtualization.
> 
> Please explain why this only affects common_timer_set() and not any other
> incarnation along with an explanation why only ABSTIME timers need to be
> converted.

Will do.

Thanks,
  Dmitry


Re: [PATCHv4 07/28] posix-timers/timens: Take into account clock offsets

2019-06-14 Thread Thomas Gleixner
On Wed, 12 Jun 2019, Dmitry Safonov wrote:

> Subject: posix-timers/timens: Take into account clock offsets

Please avoid that '/timens' appendix. It's not really a new subsystem or
subfunction of posix-timers.

posix-timers: Add time namespace support to common_timer_set()

> From: Andrei Vagin 
> 
> Wire timer_settime() syscall into time namespace virtualization.

Please explain why this only affects common_timer_set() and not any other
incarnation along with an explanation why only ABSTIME timers need to be
converted.

Thanks,

tglx


[PATCHv4 07/28] posix-timers/timens: Take into account clock offsets

2019-06-12 Thread Dmitry Safonov
From: Andrei Vagin 

Wire timer_settime() syscall into time namespace virtualization.

Signed-off-by: Andrei Vagin 
Co-developed-by: Dmitry Safonov 
Signed-off-by: Dmitry Safonov 
---
 kernel/time/posix-timers.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 573942ae2629..dba77ee48e74 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -857,6 +857,8 @@ int common_timer_set(struct k_itimer *timr, int flags,
 
timr->it_interval = timespec64_to_ktime(new_setting->it_interval);
expires = timespec64_to_ktime(new_setting->it_value);
+   if (flags & TIMER_ABSTIME)
+   expires = timens_ktime_to_host(timr->it_clock, expires);
sigev_none = timr->it_sigev_notify == SIGEV_NONE;
 
kc->timer_arm(timr, expires, flags & TIMER_ABSTIME, sigev_none);
-- 
2.22.0