[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191022084523.GA2923@gmail.com>
Date: Tue, 22 Oct 2019 01:45:23 -0700
From: Andrei Vagin <avagin@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Dmitry Safonov <dima@...sta.com>, linux-kernel@...r.kernel.org,
Dmitry Safonov <0x7f454c46@...il.com>,
Adrian Reber <adrian@...as.de>,
Andrei Vagin <avagin@...nvz.org>,
Andy Lutomirski <luto@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Christian Brauner <christian.brauner@...ntu.com>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Jann Horn <jannh@...gle.com>, Jeff Dike <jdike@...toit.com>,
Oleg Nesterov <oleg@...hat.com>,
Pavel Emelyanov <xemul@...tuozzo.com>,
Shuah Khan <shuah@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
containers@...ts.linux-foundation.org, criu@...nvz.org,
linux-api@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCHv7 00/33] kernel: Introduce Time Namespace
On Thu, Oct 17, 2019 at 04:47:48PM -0700, Andrei Vagin wrote:
>
> In my table, the "before" column is actually for the upstream kernel
> with the 18-th patch. Here is the table with the real "before" column:
>
> | before | with 18/33 | CONFIG_TIME_NS=n | host | inside timens
> ------------------------------------------------------------------------------
> avg | 150331408 | 153345935 | 153588088 | 150816637 | 139192114
> ------------------------------------------------------------------------------
> diff % | 98 | 100 | 100.1 | 98.3 | 90.7
> ------------------------------------------------------------------------------
> stdev % | 0.3 | 0.09 | 0.15 | 0.25 | 0.13
>
> If we compare numbers in "before", "host" and "inside timens" columns, we
> see the same results that you had. clock_gettime() works with the
> same performance in the host namespace and 7% slower in a time
> namespace.
>
I played with this a bit more and I've found that we can speed up
clock_gettime on 5% more if we mark do_hres and do_coarse as
__always_inline.
With the unlikely hint in vdso_read_begin and noinline for
do_hres_timens and do_coarse_timens:
1..8
ok 1 host: clock: monotonic cycles: 155278332
ok 2 host: clock: monotonic-coarse cycles: 662067077
ok 3 host: clock: monotonic-raw cycles: 151218057
ok 4 host: clock: boottime cycles: 154907635
ok 5 ns: clock: monotonic cycles: 133100433
ok 6 host: clock: monotonic-coarse cycles: 444170219
ok 7 host: clock: monotonic-raw cycles: 129550178
ok 8 ns: clock: boottime cycles: 130167136
With __always_inline for do_hres and do_coarse:
1..8
ok 1 host: clock: monotonic cycles: 163691015
ok 2 host: clock: monotonic-coarse cycles: 641443397
ok 3 host: clock: monotonic-raw cycles: 163649270
ok 4 host: clock: boottime cycles: 163682242
ok 5 ns: clock: monotonic cycles: 138759212
ok 6 host: clock: monotonic-coarse cycles: 486149502
ok 7 host: clock: monotonic-raw cycles: 134801053
ok 8 ns: clock: boottime cycles: 138675460
# Pass 8 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0
With __always_inline for do_hres, do_coarse, do_hres_timens,
do_coarse_timens:
1..8
ok 1 host: clock: monotonic cycles: 158984538
ok 2 host: clock: monotonic-coarse cycles: 594932695
ok 3 host: clock: monotonic-raw cycles: 157834511
ok 4 host: clock: boottime cycles: 158297691
ok 5 ns: clock: monotonic cycles: 148559612
ok 6 host: clock: monotonic-coarse cycles: 468505657
ok 7 host: clock: monotonic-raw cycles: 146366575
ok 8 ns: clock: boottime cycles: 148573015
# Pass 8 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0
Thanks,
Andrei
Powered by blists - more mailing lists