[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <edd9356165393818b4f1c9d4a4f3af4e561127e5.camel@xry111.site>
Date: Fri, 06 Sep 2024 01:01:13 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Christophe Leroy <christophe.leroy@...roup.eu>, "Jason A. Donenfeld"
<Jason@...c4.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Steven Rostedt
<rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>, Mathieu
Desnoyers <mathieu.desnoyers@...icios.com>, Michael Ellerman
<mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>, Naveen N Rao
<naveen@...nel.org>, Nathan Chancellor <nathan@...nel.org>, Nick
Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, Shuah Khan <shuah@...nel.org>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kselftest@...r.kernel.org, llvm@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-trace-kernel@...r.kernel.org, Adhemerval Zanella
<adhemerval.zanella@...aro.org>
Subject: Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO
implementation on VDSO32
On Thu, 2024-09-05 at 18:55 +0200, Christophe Leroy wrote:
> > Normal single thread
> > vdso: 25000000 times in 12.494133131 seconds
> > libc: 25000000 times in 69.594625188 seconds
> > syscall: 25000000 times in 67.349243972 seconds
> > Time namespace single thread
> > vdso: 25000000 times in 71.673057436 seconds
> > libc: 25000000 times in 71.712774121 seconds
> > syscall: 25000000 times in 66.902318080 seconds
> >
> > I'm seeing this on ppc, ppc64, and ppc64le.
>
> What is the command to use to test with time namespace ?
Assuming user namespace and time namespace are available:
$ unshare -r -T --boottime $((365*24*3600))
It'll start a new shell where you are pretended to be the root (i.e. the
root in the separated user namespace). Then:
# uptime
00:57:17 up 365 days, 57 min, 2 users, load average: 0.19, 0.30, 0.32
So in the separated time namespace the system is pretended to have been
booted for 1 year. Now:
# /path/to/linux.git/tools/testing/selftests/vDSO/vdso_test_getrandom bench_single
vdso: 25000000 times in 0.419125373 seconds
libc: 25000000 times in 5.985498234 seconds
syscall: 25000000 times in 5.993506773 seconds
This is on x86_64, indicating vDSO getrandom is fine for x86_64 in a
separated time namespace.
If user namespace isn't available (disabled building the kernel or
disabled by the security policy of some distros) use
$ sudo unshare -T --boottime $((365*24*3600))
to create the time namespace instead. But note that with this approach
you'll be operating as the real root user and be careful not to break
things.
--
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists