From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Igor Pylypiv <ipylypiv@google.com>,
Luis Chamberlain <mcgrof@kernel.org>,
linux-modules@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Changyuan Lyu <changyuanl@google.com>
Subject: Re: [PATCH] Revert "module, async: async_synchronize_full() on module init iff async is used"
Date: Tue, 1 Feb 2022 19:20:18 +0100 [thread overview]
Message-ID: <Yfl54vabXIbjpIGe@kroah.com> (raw)
In-Reply-To: <Yfl4Othg/8VWpd3u@slm.duckdns.org>
On Tue, Feb 01, 2022 at 08:13:14AM -1000, Tejun Heo wrote:
> Hello,
>
> On Fri, Jan 28, 2022 at 09:39:12AM +0200, Linus Torvalds wrote:
> > However, we've done this for *so* long that I wonder if there might be
> > situations that have ended up depending on the lack of synchronization
> > for pure performance reasons.
> >
> > If *this* module loading process started the async work, then we'd
> > wait for it, but what if there's other async work that was started by
> > others? This revert would now make us wait for that async work too,
> > and that might be a big deal slowing things down at boot time.
> >
> > Looking at it, this is all under the 'module_mutex', so I guess we are
> > already single-threaded at least wrt loading other modules, so the
> > amount of unrelated async work going on is presumably fairly low and
> > that isn't an issue.
>
> Looks like we're multi-threaded while running the mod inits which launch the
> async jobs and single-threaded while waiting for them to finish. Greg should
> know a lot better than me but according to my hazy memory and cursory code
> reading udev is multi-processed when loading modules, which makes it a lot
> less likely that this will impact boot time in most cases.
I think userspace is multi-processed here, which should help with the
reading of the modules from disk at boot while others are actually being
loaded due to the kernel lock.
> > Anyway, I think this patch is the right thing to do, but just the fact
> > that we've avoided that async wait for so long makes me a bit nervous
> > about fallout from the revert.
> >
> > Comments? Maybe this is a "just apply it, see if somebody screams" situation?
>
> So, yeah, I think the risk is pretty low and even in the unlikely case that
> someone is affected, the workaround is pretty straight-forward - not waiting
> for the module loading to finish if appropriate.
I agree with Linus, let's see if anyone notices :)
thanks,
greg k-h
next prev parent reply other threads:[~2022-02-01 18:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 23:39 [PATCH] Revert "module, async: async_synchronize_full() on module init iff async is used" Igor Pylypiv
2022-01-28 7:39 ` Linus Torvalds
2022-01-31 21:58 ` Igor Pylypiv
2022-02-01 18:13 ` Tejun Heo
2022-02-01 18:20 ` Greg Kroah-Hartman [this message]
2022-02-01 17:43 ` Tejun Heo
2022-02-01 17:50 ` Tejun Heo
2022-02-03 1:11 ` Luis Chamberlain
2022-02-03 19:19 ` Linus Torvalds
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=Yfl54vabXIbjpIGe@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=changyuanl@google.com \
--cc=ipylypiv@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=tj@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.