Re: [PATCH 2/2] module: add support to avoid duplicates early on load

From: Linus Torvalds
Date: Fri Jun 02 2023 - 12:07:45 EST


On Fri, Jun 2, 2023 at 11:20 AM David Hildenbrand <david@xxxxxxxxxx> wrote:
>
> What concerns me a bit, is that on the patched kernel we seem to hit more cases where
> boot takes much longer (in both kernel configs).

So it potentially serializes the loads to the same file more, but in
the process uses much less memory (since the ones waiting will not
have done any of the "load file contents and uncompress them"). So
it's a bit of a trade-off.

We could complicate things a bit, and let other callers return -EEXIST
a bit earlier, but I'm not convinced it really matters.

Honestly, taking too long because user space does something stupid and
wrong is not a kernel bug. Not booting because we use too much memory
- that's problematic. But booting slowly because udev does several
thousand unnecessary module loads is entirely on udev.

Linus