mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: 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>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] Revert "module, async: async_synchronize_full() on module init iff async is used"
Date: Tue, 1 Feb 2022 08:13:14 -1000	[thread overview]
Message-ID: <Yfl4Othg/8VWpd3u@slm.duckdns.org> (raw)
In-Reply-To: <CAHk-=whM5sHbOboEnPSfBZPQrLB-KCtzE+JXFxFRNgT95i37bw@mail.gmail.com>

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.

> 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.

Thanks.

-- 
tejun

  parent reply	other threads:[~2022-02-01 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 23:39 Igor Pylypiv
2022-01-28  7:39 ` Linus Torvalds
2022-01-31 21:58   ` Igor Pylypiv
2022-02-01 18:13   ` Tejun Heo [this message]
2022-02-01 18:20     ` Greg Kroah-Hartman
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=Yfl4Othg/8VWpd3u@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=changyuanl@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ipylypiv@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®