From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jessica Yu <jeyu@kernel.org>, Borislav Petkov <bp@alien8.de>,
Jonathan Corbet <corbet@lwn.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH v2 1/2] init/initramfs.c: allow asynchronous unpacking
Date: Sat, 13 Mar 2021 14:13:08 +0100 [thread overview]
Message-ID: <91cbb883-661b-8772-bcb1-4079a88bb324@prevas.dk> (raw)
In-Reply-To: <CAHk-=wjiNDC9QAnVGS9w9enXiErHJLdm6982VJAZFmNoPH-AEg@mail.gmail.com>
On 11/03/2021 19.02, Linus Torvalds wrote:
> On Wed, Mar 10, 2021 at 5:45 PM Rasmus Villemoes
> <linux@rasmusvillemoes.dk> wrote:
>>
>> Hm, gcc does elide the test of the return value, but jumps back to a
>> place where it always loads state from its memory location and does the
>> whole switch(). To get it to jump directly to the code implementing the
>> various do_* helpers it seems one needs to avoid that global variable
>> and instead return the next state explicitly. The below boots, but I
>> still can't see any measurable improvement on ppc.
>
> Ok. That's definitely the right way to do efficient statemachines that
> the compiler can actually generate ok code for, but if you can't
> measure the difference I guess it isn't even worth doing.
Just for good measure, I now got around to test on x86 as well, where I
thought the speculation stuff might make a difference. However, the
indirect calls through the actions[] array don't actually hurt due to
__noinitretpoline, and even removing that from the __init definition, I
only see about 1.5% difference with that state machine patch applied.
So it doesn't seem worth pursuing. I'll send v3 of the async patches
shortly.
Rasmus
next prev parent reply other threads:[~2021-03-13 13:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 14:29 [PATCH/RFC 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-02-24 14:29 ` [PATCH/RFC 1/2] init/initramfs.c: allow asynchronous unpacking Rasmus Villemoes
2021-02-24 17:17 ` Linus Torvalds
2021-02-24 22:13 ` Rasmus Villemoes
2021-03-02 16:26 ` Luis Chamberlain
2021-02-24 14:29 ` [PATCH/RFC 2/2] modules: add CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-02-24 22:19 ` [PATCH/RFC 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-03-09 21:16 ` [PATCH v2 " Rasmus Villemoes
2021-03-09 21:16 ` [PATCH v2 1/2] init/initramfs.c: allow asynchronous unpacking Rasmus Villemoes
2021-03-09 22:07 ` Linus Torvalds
2021-03-09 22:39 ` Rasmus Villemoes
2021-03-11 17:55 ` Luis Chamberlain
2021-03-09 22:16 ` Linus Torvalds
2021-03-09 22:51 ` Rasmus Villemoes
2021-03-11 0:17 ` Rasmus Villemoes
2021-03-11 1:45 ` Rasmus Villemoes
2021-03-11 18:02 ` Linus Torvalds
2021-03-13 13:13 ` Rasmus Villemoes [this message]
2021-03-09 21:17 ` [PATCH v2 2/2] modules: add CONFIG_MODPROBE_PATH Rasmus Villemoes
2021-03-10 9:46 ` Greg Kroah-Hartman
2021-03-11 13:28 ` Jessica Yu
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=91cbb883-661b-8772-bcb1-4079a88bb324@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mcgrof@kernel.org \
--cc=ndesaulniers@google.com \
--cc=torvalds@linux-foundation.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