From: Luis Chamberlain <mcgrof@kernel.org>
To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
pmladek@suse.com, david@redhat.com, petr.pavlu@suse.com,
prarit@redhat.com
Cc: christophe.leroy@csgroup.eu, song@kernel.org, mcgrof@kernel.org
Subject: [RFT 0/5] module: avoid userspace pressure on unwanted allocations
Date: Sun, 19 Mar 2023 14:49:21 -0700 [thread overview]
Message-ID: <20230319214926.1794108-1-mcgrof@kernel.org> (raw)
Finally this third patch set spins the first RFC I put out to help
reduce memory pressure [0]. It updates the commit log with some stats
obtained on a guest, but I need to do more tests on more systems and
then also with stress-ng. I posted a patch to run stress-ng for modules,
so it stresses running finit_module() [1]. Using that instead of
kmod test 0008 should be useful as that really puts some heavy load
without going through the kernel module auto-loader, that has a
restriction of just allowing 50 threads concurrently. The issue with
that stress test so far is that unloading doesn't seem to unload yet.
The last patch is purely for testing purposes and its value can only be
shown if it really does help the use case of a large system with many
CPUs. That situation is known currently to cuase issues with subsystems
which end up loading tons of the same drivers and so this tries to be
a bit defensive for subsystems that might need some love in this area.
I have two trees for this patchset, the first one had the ELF checker
and validity tests at the end [2], and the latest one re-adjusts the
ordering to put this patch set as the last series [3], in line with
the order in which I've submitted the patches. I had only run time
tested the patch order on [2] but it makes sense to put more of the
heavier functional changes at the very end, and request for further
testing.
[0] https://lkml.kernel.org/r/20230311051712.4095040-1-mcgrof@kernel.org
[1] https://lore.kernel.org/all/ZBUA6E3kYh0Xuu/c@bombadil.infradead.org/?q=stress-ng+mcgrof
[2] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=20230319-module-alloc-opts
Luis Chamberlain (5):
module: move finished_loading()
module: extract patient module check into helper
module: avoid allocation if module is already present and ready
module: use list_add_tail_rcu() when adding module
module: add a sanity check prior to allowing kernel module
auto-loading
kernel/module/internal.h | 1 +
kernel/module/kmod.c | 7 ++
kernel/module/main.c | 139 ++++++++++++++++++++++++---------------
3 files changed, 93 insertions(+), 54 deletions(-)
--
2.39.1
next reply other threads:[~2023-03-19 21:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-19 21:49 Luis Chamberlain [this message]
2023-03-19 21:49 ` [RFT 1/5] module: move finished_loading() Luis Chamberlain
2023-03-19 21:49 ` [RFT 2/5] module: extract patient module check into helper Luis Chamberlain
2023-03-19 21:49 ` [RFT 3/5] module: avoid allocation if module is already present and ready Luis Chamberlain
2023-03-19 21:49 ` [RFT 4/5] module: use list_add_tail_rcu() when adding module Luis Chamberlain
2023-03-19 21:49 ` [RFT 5/5] module: add a sanity check prior to allowing kernel module auto-loading Luis Chamberlain
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=20230319214926.1794108-1-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=petr.pavlu@suse.com \
--cc=pmladek@suse.com \
--cc=prarit@redhat.com \
--cc=song@kernel.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