platform_bionic/libc/arch-mips64/syscalls
Mark Salyzyn 79249b0897 bionic: add vdso clock_getres
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
2017-12-07 09:41:48 -08:00
..
___clock_nanosleep.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___close.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___faccessat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___fchmod.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___fchmodat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___fgetxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___flistxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___fsetxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___mremap.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
___rt_sigqueueinfo.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__accept4.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__brk.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__clock_getres.S bionic: add vdso clock_getres 2017-12-07 09:41:48 -08:00
__clock_gettime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__connect.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__epoll_pwait.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__exit.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__fadvise64.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__fstatfs.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__getcpu.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__getcwd.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__getdents64.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__getpid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__getpriority.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__gettimeofday.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__ioctl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__openat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__ppoll.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__pselect6.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__ptrace.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__reboot.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__rt_sigaction.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__rt_sigpending.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__rt_sigprocmask.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__rt_sigsuspend.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__rt_sigtimedwait.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__sched_getaffinity.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__set_tid_address.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__set_tls.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__signalfd4.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__socket.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__statfs.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__sync_file_range.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__timer_create.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__timer_delete.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__timer_getoverrun.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__timer_gettime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__timer_settime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
__waitid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
_exit.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
acct.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
adjtimex.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
bind.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
capget.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
capset.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
chdir.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
chroot.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
clock_adjtime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
clock_settime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
delete_module.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
dup.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
dup3.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
epoll_create1.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
epoll_ctl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
eventfd.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
execve.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fallocate.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fchdir.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fchown.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fchownat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fcntl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fdatasync.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
flock.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fremovexattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
fsync.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
ftruncate.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getegid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
geteuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getgroups.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getitimer.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getpeername.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getpgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getppid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getrandom.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getresgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getresuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getrlimit.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getrusage.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getsid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getsockname.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getsockopt.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
getxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
init_module.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
inotify_add_watch.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
inotify_init1.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
inotify_rm_watch.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
kill.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
klogctl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
lgetxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
linkat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
listen.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
listxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
llistxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
lremovexattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
lseek.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
lsetxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
madvise.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mincore.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mkdirat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mknodat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mlock.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mlockall.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mmap.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mount.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
mprotect.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
msync.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
munlock.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
munlockall.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
munmap.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
nanosleep.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
personality.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
pipe2.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
prctl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
pread64.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
preadv.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
prlimit64.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
process_vm_readv.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
process_vm_writev.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
pwrite64.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
pwritev.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
quotactl.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
read.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
readahead.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
readlinkat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
readv.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
recvfrom.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
recvmmsg.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
recvmsg.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
removexattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
renameat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_get_priority_max.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_get_priority_min.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_getparam.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_getscheduler.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_rr_get_interval.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_setaffinity.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_setparam.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_setscheduler.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sched_yield.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sendfile.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sendmmsg.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sendmsg.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sendto.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setdomainname.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setfsgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setfsuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setgroups.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sethostname.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setitimer.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setns.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setpgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setpriority.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setregid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setresgid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setresuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setreuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setrlimit.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setsid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setsockopt.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
settimeofday.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setuid.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
setxattr.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
shutdown.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sigaltstack.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
socketpair.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
splice.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
swapoff.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
swapon.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
symlinkat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sync.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
syncfs.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
sysinfo.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
tee.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
tgkill.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
timerfd_create.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
timerfd_gettime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
timerfd_settime.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
times.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
truncate.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
umask.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
umount2.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
uname.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
unlinkat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
unshare.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
utimensat.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
vmsplice.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
wait4.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
write.S Fix mip64 build. 2017-10-13 13:22:24 -07:00
writev.S Fix mip64 build. 2017-10-13 13:22:24 -07:00