Skip to content

module: avoid all memory pressure due to duplicates

Luis Chamberlain linux-fsdevel linux-mm linux-modules linux-patches lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 50 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs/kernel_read_file: add support for duplicate detectionfs/Kconfig fs/kernel_read_file.c include/linux/kernel_read_file.h+141 -09 replies
2/2module: add support to avoid duplicates early on loadinclude/linux/module.h kernel/module/Kconfig kernel/module/internal.h +1 more+34 -741 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchLuis ChamberlainDan WilliamsDavid HildenbrandRudi HeitbaumJohan Hovold
1/2
2/2T-b T-b T-b T-b T-b R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] module: avoid all memory pressure due to duplicates

We now know that duplicate kernel module loading can incur considerable vmalloc memory pressure on boot. Module loading uses vmalloc space 3 times in the worst case. Detecting duplicates early before processing the module name was the last mile we had to go and we recently were debating if userspace should fix this or the kernel should fix this. We decided to punt the problem to userspace.

At LSFMM 2023 in Vancouver this year I talked to Lennart Poettering about this and described the issue with udev. Fixing this in userspace would be complex, and it was preferable if we could resolve this in-kernel. And indeed it is possible to resolve it relatively easily in-kernel with just the inode. So let's do that and be done with the issue.

Patch #2 has the details on the savings on a 255 CPU system.

With this we get 0 bytes wasted incurred due to duplicates.

Luis Chamberlain (2):
fs/kernel_read_file: add support for duplicate detection
module: add support to avoid duplicates early on load

 fs/Kconfig                       |   3 +
 fs/kernel_read_file.c            | 124 +++++++++++++++++++++++++++++++
 include/linux/kernel_read_file.h |  14 ++++
 include/linux/module.h           |   1 +
 kernel/module/Kconfig            |  20 +++++
 kernel/module/internal.h         |   1 +
 kernel/module/main.c             |  19 +++--
 7 files changed, 175 insertions(+), 7 deletions(-)
Signature · 1 line
2.39.2