79249b0897
clock_getres() should not be a hot call, nevertheless it is ~6-7 times faster for supported clock ids if it uses __vdso_clock_getres if available. There is a 3% performance penalty for unsupported clock ids via __vdso_clock_getres with respect to a direct syscall. [TL;DR] w/vdso32 kernel patches, locked cores to MAX, little cores only. BEFORE: hikey960 vdso (aarch64): ---------------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------------- BM_time_clock_getres 126 ns 126 ns 5577874 BM_time_clock_getres_syscall 127 ns 127 ns 5505016 BM_time_clock_getres_REALTIME 126 ns 126 ns 5574682 BM_time_clock_getres_BOOTTIME 126 ns 126 ns 5575237 BM_time_clock_getres_TAI 126 ns 126 ns 5576810 BM_time_clock_getres_unsupported 128 ns 128 ns 5480189 hikey960 vdso32 (aarch32): ---------------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------------- BM_time_clock_getres 199 ns 199 ns 3508708 BM_time_clock_getres_syscall 220 ns 220 ns 3184676 BM_time_clock_getres_REALTIME 199 ns 199 ns 3509697 BM_time_clock_getres_BOOTTIME 199 ns 199 ns 3513551 BM_time_clock_getres_TAI 200 ns 199 ns 3512412 BM_time_clock_getres_unsupported 196 ns 196 ns 3575609 x86_64 (glibc): --------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------- BM_time_clock_getres 252 ns 252 ns 2370263 BM_time_clock_getres_syscall 215 ns 215 ns 3287497 BM_time_clock_getres_REALTIME 214 ns 214 ns 3294228 BM_time_clock_getres_BOOTTIME 213 ns 213 ns 3277519 BM_time_clock_getres_TAI 213 ns 213 ns 3294991 BM_time_clock_getres_unsupported 206 ns 206 ns 3450654 imx7d_pico IOT nyc (w/arm,cpu-registers-not-fw-configured) (armv7a): (Virtual Timers) Benchmark Time(ns) CPU(ns) Iterations ------------------------------------------------------------------ BM_time_clock_getres 16 345 2000000 BM_time_clock_getres_syscall 16 339 2121212 BM_time_clock_getres_REALTIME 17 350 2058824 BM_time_clock_getres_BOOTTIME 17 345 2000000 BM_time_clock_getres_TAI 16 350 2000000 BM_time_clock_getres_unsupported 13 284 2500000 AFTER: hikey960 vdso (aarch64): --------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------- BM_time_clock_getres 18 ns 18 ns 37880389 BM_time_clock_getres_syscall 127 ns 127 ns 5520029 BM_time_clock_getres_REALTIME 18 ns 18 ns 37879962 BM_time_clock_getres_BOOTTIME 19 ns 18 ns 37878361 BM_time_clock_getres_TAI 131 ns 131 ns 5368484 BM_time_clock_getres_unsupported 97 ns 97 ns 7182864 hikey960 vdso32 (aarch32): --------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------- BM_time_clock_getres 36 ns 36 ns 19205240 BM_time_clock_getres_syscall 212 ns 212 ns 3297100 BM_time_clock_getres_REALTIME 36 ns 36 ns 19219109 BM_time_clock_getres_BOOTTIME 36 ns 36 ns 19222490 BM_time_clock_getres_TAI 206 ns 206 ns 3402868 BM_time_clock_getres_unsupported 159 ns 159 ns 4409492 imx7d_pico IOT nyc (wo/arm,cpu-registers-not-fw-configured) (armv7a): (Physical Timers) Benchmark Time(ns) CPU(ns) Iterations ------------------------------------------------------------------ BM_time_clock_getres 2 48 14000000 BM_time_clock_getres_syscall 14 335 2058824 BM_time_clock_getres_REALTIME 2 49 14583333 BM_time_clock_getres_BOOTTIME 2 48 14000000 BM_time_clock_getres_TAI 14 350 2058824 BM_time_clock_getres_unsupported 8 203 3500000 Test: taskset F \ /data/benchmarktest{64}/bionic-benchmarks/bionic-benchmarks \ --bionic_xml=vdso.xml --benchmark_filter=BM_time_clock_getres* Bug: 63737556 Change-Id: I80c0a5106625d76720287f715fcf145d2aad1705 |
||
---|---|---|
.. | ||
___clock_nanosleep.S | ||
___close.S | ||
___faccessat.S | ||
___fchmod.S | ||
___fchmodat.S | ||
___fgetxattr.S | ||
___flistxattr.S | ||
___fsetxattr.S | ||
___mremap.S | ||
___rt_sigqueueinfo.S | ||
__accept4.S | ||
__brk.S | ||
__clock_getres.S | ||
__clock_gettime.S | ||
__connect.S | ||
__epoll_pwait.S | ||
__exit.S | ||
__fadvise64.S | ||
__fstatfs.S | ||
__getcpu.S | ||
__getcwd.S | ||
__getdents64.S | ||
__getpid.S | ||
__getpriority.S | ||
__gettimeofday.S | ||
__ioctl.S | ||
__openat.S | ||
__ppoll.S | ||
__pselect6.S | ||
__ptrace.S | ||
__reboot.S | ||
__rt_sigaction.S | ||
__rt_sigpending.S | ||
__rt_sigprocmask.S | ||
__rt_sigsuspend.S | ||
__rt_sigtimedwait.S | ||
__sched_getaffinity.S | ||
__set_tid_address.S | ||
__set_tls.S | ||
__signalfd4.S | ||
__socket.S | ||
__statfs.S | ||
__sync_file_range.S | ||
__timer_create.S | ||
__timer_delete.S | ||
__timer_getoverrun.S | ||
__timer_gettime.S | ||
__timer_settime.S | ||
__waitid.S | ||
_exit.S | ||
acct.S | ||
adjtimex.S | ||
bind.S | ||
capget.S | ||
capset.S | ||
chdir.S | ||
chroot.S | ||
clock_adjtime.S | ||
clock_settime.S | ||
delete_module.S | ||
dup.S | ||
dup3.S | ||
epoll_create1.S | ||
epoll_ctl.S | ||
eventfd.S | ||
execve.S | ||
fallocate.S | ||
fchdir.S | ||
fchown.S | ||
fchownat.S | ||
fcntl.S | ||
fdatasync.S | ||
flock.S | ||
fremovexattr.S | ||
fsync.S | ||
ftruncate.S | ||
getegid.S | ||
geteuid.S | ||
getgid.S | ||
getgroups.S | ||
getitimer.S | ||
getpeername.S | ||
getpgid.S | ||
getppid.S | ||
getrandom.S | ||
getresgid.S | ||
getresuid.S | ||
getrlimit.S | ||
getrusage.S | ||
getsid.S | ||
getsockname.S | ||
getsockopt.S | ||
getuid.S | ||
getxattr.S | ||
init_module.S | ||
inotify_add_watch.S | ||
inotify_init1.S | ||
inotify_rm_watch.S | ||
kill.S | ||
klogctl.S | ||
lgetxattr.S | ||
linkat.S | ||
listen.S | ||
listxattr.S | ||
llistxattr.S | ||
lremovexattr.S | ||
lseek.S | ||
lsetxattr.S | ||
madvise.S | ||
mincore.S | ||
mkdirat.S | ||
mknodat.S | ||
mlock.S | ||
mlockall.S | ||
mmap.S | ||
mount.S | ||
mprotect.S | ||
msync.S | ||
munlock.S | ||
munlockall.S | ||
munmap.S | ||
nanosleep.S | ||
personality.S | ||
pipe2.S | ||
prctl.S | ||
pread64.S | ||
preadv.S | ||
prlimit64.S | ||
process_vm_readv.S | ||
process_vm_writev.S | ||
pwrite64.S | ||
pwritev.S | ||
quotactl.S | ||
read.S | ||
readahead.S | ||
readlinkat.S | ||
readv.S | ||
recvfrom.S | ||
recvmmsg.S | ||
recvmsg.S | ||
removexattr.S | ||
renameat.S | ||
sched_get_priority_max.S | ||
sched_get_priority_min.S | ||
sched_getparam.S | ||
sched_getscheduler.S | ||
sched_rr_get_interval.S | ||
sched_setaffinity.S | ||
sched_setparam.S | ||
sched_setscheduler.S | ||
sched_yield.S | ||
sendfile.S | ||
sendmmsg.S | ||
sendmsg.S | ||
sendto.S | ||
setdomainname.S | ||
setfsgid.S | ||
setfsuid.S | ||
setgid.S | ||
setgroups.S | ||
sethostname.S | ||
setitimer.S | ||
setns.S | ||
setpgid.S | ||
setpriority.S | ||
setregid.S | ||
setresgid.S | ||
setresuid.S | ||
setreuid.S | ||
setrlimit.S | ||
setsid.S | ||
setsockopt.S | ||
settimeofday.S | ||
setuid.S | ||
setxattr.S | ||
shutdown.S | ||
sigaltstack.S | ||
socketpair.S | ||
splice.S | ||
swapoff.S | ||
swapon.S | ||
symlinkat.S | ||
sync.S | ||
syncfs.S | ||
sysinfo.S | ||
tee.S | ||
tgkill.S | ||
timerfd_create.S | ||
timerfd_gettime.S | ||
timerfd_settime.S | ||
times.S | ||
truncate.S | ||
umask.S | ||
umount2.S | ||
uname.S | ||
unlinkat.S | ||
unshare.S | ||
utimensat.S | ||
vmsplice.S | ||
wait4.S | ||
write.S | ||
writev.S |