[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230524213620.3509138-1-mcgrof@kernel.org>
Date: Wed, 24 May 2023 14:36:18 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: david@...hat.com, tglx@...utronix.de, hch@....de,
patches@...ts.linux.dev, linux-modules@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, pmladek@...e.com,
petr.pavlu@...e.com, prarit@...hat.com,
torvalds@...ux-foundation.org, lennart@...ttering.net
Cc: gregkh@...uxfoundation.org, rafael@...nel.org, song@...nel.org,
lucas.de.marchi@...il.com, lucas.demarchi@...el.com,
christophe.leroy@...roup.eu, peterz@...radead.org, rppt@...nel.org,
dave@...olabs.net, willy@...radead.org, vbabka@...e.cz,
mhocko@...e.com, dave.hansen@...ux.intel.com,
colin.i.king@...il.com, jim.cromie@...il.com,
catalin.marinas@....com, jbaron@...mai.com,
rick.p.edgecombe@...el.com, yujie.liu@...el.com, mcgrof@...nel.org
Subject: [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(-)
--
2.39.2
Powered by blists - more mailing lists