From: Hauke Mehrtens <hauke@hauke-m.de>
To: markos.chandras@imgtec.com, Alex Smith <alex.smith@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: vdso clock_gettime() sometimes broken after sleep
Date: Sat, 20 Feb 2016 13:01:40 +0100 [thread overview]
Message-ID: <56C855A4.8080403@hauke-m.de> (raw)
In-Reply-To: <56ABDA74.9010203@hauke-m.de>
On 01/29/2016 10:32 PM, Hauke Mehrtens wrote:
> When using the vdso clock_gettime() it looks like that the clock is
> sometimes not going forward when the process sleeps and the clock also
> sleeps. This problem only happens with the vdso clock and not with the
> normal syscall clock.
>
> I wrote a small test program which calls the syscall and the vdso
> version. In the first call they are showing the same time, but after I
> sleeped for 1 second, they are off by one second. This problem occurs
> not 100% reliable but I see it pretty often. Only the CLOCK_REALTIME and
> CLOCK_MONOTONIC seam to be affected CLOCK_REALTIME_COARSE is not affected.
>
> I am using an MIPS BE 34Kc V5.6 CPU with two VPEs, but only one is used.
> This is a Lantiq VRX200 SoC with OpenWrt Linux kernel 4.4 and musl libc.
>
> Hauke
Hi,
Any news on this? For me this is a usespace API regression. Should I
send a patch deactivating the vdso support only for the MIPS 34Kc CPU or
for completely for mips?
Hauke
> Here are my measurements:
>
> start test
> syscall: CLOCK_REALTIME: tv_sec: 1454098944, tv_nsec: 463189916
> vdso: CLOCK_REALTIME: tv_sec: 1454098944, tv_nsec: 463242196
> syscall: CLOCK_REALTIME_COARSE: tv_sec: 1454098944, tv_nsec: 456000000
> vdso: CLOCK_REALTIME_COARSE: tv_sec: 1454098944, tv_nsec: 456000000
> syscall: CLOCK_MONOTONIC: tv_sec: 107, tv_nsec: 28113172
> vdso: CLOCK_MONOTONIC: tv_sec: 107, tv_nsec: 32150208
> syscall: CLOCK_MONOTONIC_COARSE: tv_sec: 107, tv_nsec: 24678324
> vdso: CLOCK_MONOTONIC_COARSE: tv_sec: 107, tv_nsec: 24678324
> syscall: CLOCK_MONOTONIC_RAW: tv_sec: 107, tv_nsec: 28263008
> vdso: CLOCK_MONOTONIC_RAW: tv_sec: 107, tv_nsec: 28300760
> syscall: CLOCK_BOOTTIME: tv_sec: 107, tv_nsec: 28337540
> vdso: CLOCK_BOOTTIME: tv_sec: 107, tv_nsec: 28379100
> syscall: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 3111128
> vdso: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 3153120
> syscall: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 3192208
> vdso: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 3231696
> sleep(1)
> syscall: CLOCK_REALTIME: tv_sec: 1454098945, tv_nsec: 464023036
> vdso: CLOCK_REALTIME: tv_sec: 1454098946, tv_nsec: 468077456
> syscall: CLOCK_REALTIME_COARSE: tv_sec: 1454098945, tv_nsec: 460000000
> vdso: CLOCK_REALTIME_COARSE: tv_sec: 1454098945, tv_nsec: 460000000
> syscall: CLOCK_MONOTONIC: tv_sec: 108, tv_nsec: 28874940
> vdso: CLOCK_MONOTONIC: tv_sec: 109, tv_nsec: 32911852
> syscall: CLOCK_MONOTONIC_COARSE: tv_sec: 108, tv_nsec: 24678324
> vdso: CLOCK_MONOTONIC_COARSE: tv_sec: 108, tv_nsec: 24678324
> syscall: CLOCK_MONOTONIC_RAW: tv_sec: 108, tv_nsec: 29023384
> vdso: CLOCK_MONOTONIC_RAW: tv_sec: 108, tv_nsec: 29061372
> syscall: CLOCK_BOOTTIME: tv_sec: 108, tv_nsec: 29097912
> vdso: CLOCK_BOOTTIME: tv_sec: 108, tv_nsec: 29139864
> syscall: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 3824540
> vdso: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 3865708
> syscall: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 3904680
> vdso: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 3943892
> sleep(2)
> syscall: CLOCK_REALTIME: tv_sec: 1454098947, tv_nsec: 464791376
> vdso: CLOCK_REALTIME: tv_sec: 1454098950, tv_nsec: 468847600
> syscall: CLOCK_REALTIME_COARSE: tv_sec: 1454098947, tv_nsec: 460000000
> vdso: CLOCK_REALTIME_COARSE: tv_sec: 1454098947, tv_nsec: 460000000
> syscall: CLOCK_MONOTONIC: tv_sec: 110, tv_nsec: 29644468
> vdso: CLOCK_MONOTONIC: tv_sec: 113, tv_nsec: 33682152
> syscall: CLOCK_MONOTONIC_COARSE: tv_sec: 110, tv_nsec: 24678324
> vdso: CLOCK_MONOTONIC_COARSE: tv_sec: 110, tv_nsec: 24678324
> syscall: CLOCK_MONOTONIC_RAW: tv_sec: 110, tv_nsec: 29794136
> vdso: CLOCK_MONOTONIC_RAW: tv_sec: 110, tv_nsec: 29831728
> syscall: CLOCK_BOOTTIME: tv_sec: 110, tv_nsec: 29868576
> vdso: CLOCK_BOOTTIME: tv_sec: 110, tv_nsec: 29909920
> syscall: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 4547416
> vdso: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 4589684
> syscall: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 4628872
> vdso: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 4668808
> sleep(3)
> syscall: CLOCK_REALTIME: tv_sec: 1454098950, tv_nsec: 465558716
> vdso: CLOCK_REALTIME: tv_sec: 1454098956, tv_nsec: 469613960
> syscall: CLOCK_REALTIME_COARSE: tv_sec: 1454098950, tv_nsec: 460000000
> vdso: CLOCK_REALTIME_COARSE: tv_sec: 1454098950, tv_nsec: 460000000
> syscall: CLOCK_MONOTONIC: tv_sec: 113, tv_nsec: 30411308
> vdso: CLOCK_MONOTONIC: tv_sec: 119, tv_nsec: 34448236
> syscall: CLOCK_MONOTONIC_COARSE: tv_sec: 113, tv_nsec: 24678324
> vdso: CLOCK_MONOTONIC_COARSE: tv_sec: 113, tv_nsec: 24678324
> syscall: CLOCK_MONOTONIC_RAW: tv_sec: 113, tv_nsec: 30559184
> vdso: CLOCK_MONOTONIC_RAW: tv_sec: 113, tv_nsec: 30596676
> syscall: CLOCK_BOOTTIME: tv_sec: 113, tv_nsec: 30632568
> vdso: CLOCK_BOOTTIME: tv_sec: 113, tv_nsec: 30673204
> syscall: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 5262328
> vdso: CLOCK_PROCESS_CPUTIME_ID: tv_sec: 0, tv_nsec: 5304576
> syscall: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 5343136
> vdso: CLOCK_THREAD_CPUTIME_ID: tv_sec: 0, tv_nsec: 5382616
>
prev parent reply other threads:[~2016-02-20 12:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 21:32 vdso clock_gettime() sometimes broken after sleep Hauke Mehrtens
2016-02-20 12:01 ` Hauke Mehrtens [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C855A4.8080403@hauke-m.de \
--to=hauke@hauke-m.de \
--cc=alex.smith@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=markos.chandras@imgtec.com \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.