From: Xi Ruoyao <xry111@xry111.site>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
"Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Naveen N Rao <naveen@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kselftest@vger.kernel.org, llvm@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-trace-kernel@vger.kernel.org,
Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32
Date: Fri, 06 Sep 2024 01:01:13 +0800 [thread overview]
Message-ID: <edd9356165393818b4f1c9d4a4f3af4e561127e5.camel@xry111.site> (raw)
In-Reply-To: <85c02620-e8b2-4c97-9905-685a9a4e556d@csgroup.eu>
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@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2024-09-05 17:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 19:17 [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc Christophe Leroy
2024-09-02 19:17 ` [PATCH v5 1/5] mm: Define VM_DROPPABLE for powerpc/32 Christophe Leroy
2024-09-02 19:17 ` [PATCH v5 2/5] powerpc/vdso32: Add crtsavres Christophe Leroy
2024-09-02 19:17 ` [PATCH v5 3/5] powerpc/vdso: Refactor CFLAGS for CVDSO build Christophe Leroy
2024-09-02 19:17 ` [PATCH v5 4/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32 Christophe Leroy
2024-09-05 16:13 ` Jason A. Donenfeld
2024-09-05 16:25 ` Jason A. Donenfeld
2024-09-05 16:55 ` Christophe Leroy
2024-09-05 17:01 ` Xi Ruoyao [this message]
2024-09-05 17:03 ` Jason A. Donenfeld
2024-09-05 17:16 ` Jason A. Donenfeld
2024-09-05 20:41 ` Jason A. Donenfeld
2024-09-06 2:48 ` Jason A. Donenfeld
2024-09-06 3:24 ` Jason A. Donenfeld
2024-09-06 4:53 ` Christophe Leroy
2024-09-02 19:17 ` [PATCH v5 5/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO64 Christophe Leroy
2024-09-04 11:46 ` Madhavan Srinivasan
2024-09-04 14:16 ` [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc Jason A. Donenfeld
2024-09-04 14:36 ` Christophe Leroy
2024-09-05 12:18 ` Michael Ellerman
2024-09-05 12:56 ` Jason A. Donenfeld
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=edd9356165393818b4f1c9d4a4f3af4e561127e5.camel@xry111.site \
--to=xry111@xry111.site \
--cc=Jason@zx2c4.com \
--cc=adhemerval.zanella@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=christophe.leroy@csgroup.eu \
--cc=justinstitt@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=llvm@lists.linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=morbo@google.com \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=naveen@kernel.org \
--cc=ndesaulniers@google.com \
--cc=npiggin@gmail.com \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox