public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Saravana Kannan <saravanak@google.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kevin Hilman <khilman@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Will Deacon <will@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Android Kernel Team <kernel-team@android.com>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: Default async probing for DT based systems
Date: Thu, 23 Jun 2022 11:55:41 +0200	[thread overview]
Message-ID: <YrQ4naL9SJGbh+yJ@kroah.com> (raw)
In-Reply-To: <CAGETcx-MHwex8tHLB1d71MAP01-3OPDZSNCUBb3iT+BtrugJmQ@mail.gmail.com>

On Wed, Jun 22, 2022 at 07:36:24PM -0700, Saravana Kannan wrote:
> On Fri, Jun 17, 2022 at 11:04 AM Saravana Kannan <saravanak@google.com> wrote:
> >
> > On Fri, Jun 17, 2022 at 2:04 AM Marek Szyprowski
> > <m.szyprowski@samsung.com> wrote:
> > >
> > > Hi Saravana,
> > >
> > > On 16.06.2022 05:24, Saravana Kannan wrote:
> > > > Hi,
> > > >
> > > > TL;DR: I want to improve boot times by enabling async probing by
> > > > default for DT based systems. Can you give it a shot please?
> > >
> > > Yes, I've gave it a try on my test systems. It looks that there are a
> > > few issues. The first one, the most obvious to notice, is related to
> > > __request_module() calls from various drivers and frameworks. Here are
> > > some examples:
> > >
> > > ------------[ cut here ]------------
> > > WARNING: CPU: 3 PID: 73 at kernel/kmod.c:136 __request_module+0x230/0x600
> > > Modules linked in:
> > > CPU: 3 PID: 73 Comm: kworker/u12:5 Not tainted 5.19.0-rc2-next-20220615+
> > > #5203
> > > Hardware name: ARM Juno development board (r1) (DT)
> > > Workqueue: events_unbound async_run_entry_fn
> > > pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> > > UDC core: g_ether: couldn't find an available UDC
> > > pc : __request_module+0x230/0x600
> > > lr : __request_module+0x228/0x600
> >
> > Ah, I think I know what these might be. Going by memory,
> > __request_module() from asyc thread context has some issues for module
> > loading. So I think a check was added like this. And I think the check
> > is triggering when it shouldn't (this isn't module context here).
> 
> My memory was right and this is indeed the spurious warning that was
> meant to cover a potential deadlock in a module load path. I was
> trying to disable this warning till we hit the point in the boot flow
> where request_module() can actually succeed. But I got stuck trying to
> figure it out.
> 
> It looks like the usermode helper that's used for module loading
> triggered by request_module() is enabled in populate_rootfs() that
> runs well before most of the initcalls are done. I was under the
> impression that init with pid 0 would be the first userspace thread
> that can start. But I don't see anything obvious that prevents the
> usermode helper from running and loading a module before init process
> has been exec'ed after we set system_state to SYSTEM_RUNNING.
> 
> Can someone clarify when is the earliest request_module() can succeed?

It can succeed very very early, when we have the initial ramfs mounted
before init runs as you sometimes need the modules there to be able to
load the device that init is on.

thanks,

greg k-h

      reply	other threads:[~2022-06-23  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220616032522eucas1p19a6c8718f01fa61c2fee795fb8945a92@eucas1p1.samsung.com>
2022-06-16  3:24 ` Default async probing for DT based systems Saravana Kannan
2022-06-16 16:45   ` Frank Rowand
2022-06-17  8:21   ` Linus Walleij
2022-06-17 18:00     ` Saravana Kannan
2022-06-25 18:09       ` Linus Walleij
2022-06-27  6:10         ` Saravana Kannan
2022-06-17  9:03   ` Marek Szyprowski
2022-06-17 18:04     ` Saravana Kannan
2022-06-23  2:36       ` Saravana Kannan
2022-06-23  9:55         ` Greg Kroah-Hartman [this message]

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=YrQ4naL9SJGbh+yJ@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=geert+renesas@glider.be \
    --cc=kernel-team@android.com \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maz@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    --cc=ulf.hansson@linaro.org \
    --cc=will@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