linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] module: Remove stop_machine from module unloading
@ 2014-08-25 10:55 Masami Hiramatsu
  2014-08-25 10:55 ` [RFC PATCH 1/5] module: Wait for RCU synchronizing before releasing a module Masami Hiramatsu
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Masami Hiramatsu @ 2014-08-25 10:55 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Lucas De Marchi, Linux Kernel Mailing List, Josh Poimboeuf

Hi,

Here is a series of patches which remove stop_machine() from
module unloading.

Currently, each module unloading calls stop_machine()s 2 times.
One is for safely removing module from lists and one is to
check the reference counter. However, both are not necessary
for those purposes (required by current implementation).

First, we can use RCU for the list operation, we just need
a synchronize_rcu right before cleaning up.
Second, the reference counter can be checked atomically by
using atomic_t, instead of per-cpu module_ref. Of course,
for BIG SMP machines, atomic operation is not efficient.
However, they usually don't need to remove most of modules too.

In this series, I just fixed to use RCU for the module(and
bugs) list for the first stop_machine.
And for the second one, I replaced module_ref with atomic_t
and introduced a "module lockup" module load option, which
makes a module un-removable (lock up the module in kernel).
The lockup modules can not be removed except forced, and the
kernel skips module refcounting on those modules. Thus we
can minimize the performance impact on the BIG SMP machines.

BTW, of course this requires to update libkmod to support
new MODULE_INIT_LOCKUP_MODULE flag. I'm not sure where is
good to send the patches I have. Sould I better sending
kmod patches on LKML?

Thank you,

---

Masami Hiramatsu (5):
      module: Wait for RCU synchronizing before releasing a module
      module: Unlink module with RCU synchronizing instead of stop_machine
      lib/bug: Use RCU list ops for module_bug_list
      module: Lock up a module when loading with a LOCLUP flag
      module: Remove stop_machine from module unloading


 include/linux/module.h        |   22 ++----
 include/trace/events/module.h |    2 -
 include/uapi/linux/module.h   |    1 
 kernel/module.c               |  147 +++++++++++++++++------------------------
 lib/bug.c                     |   20 ++++--
 5 files changed, 85 insertions(+), 107 deletions(-)

--


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-10-22  4:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-25 10:55 [RFC PATCH 0/5] module: Remove stop_machine from module unloading Masami Hiramatsu
2014-08-25 10:55 ` [RFC PATCH 1/5] module: Wait for RCU synchronizing before releasing a module Masami Hiramatsu
2014-08-25 10:55 ` [RFC PATCH 2/5] module: Unlink module with RCU synchronizing instead of stop_machine Masami Hiramatsu
2014-08-25 10:55 ` [RFC PATCH 3/5] lib/bug: Use RCU list ops for module_bug_list Masami Hiramatsu
2014-08-25 10:55 ` [RFC PATCH 4/5] module: Lock up a module when loading with a LOCLUP flag Masami Hiramatsu
2014-08-26  5:30   ` Lucas De Marchi
2014-08-26  9:26     ` Masami Hiramatsu
2014-08-26 12:04       ` [RFC PATCH 0/2] kmod: Support lockup option to make module un-removable Masami Hiramatsu
2014-08-26 12:04         ` [RFC PATCH 1/2] libkmod: support lockup module option Masami Hiramatsu
2014-08-26 12:04         ` [RFC PATCH 2/2] modprobe: Add --lockup option to make module unremovable Masami Hiramatsu
2014-09-01 22:17         ` [RFC PATCH 0/2] kmod: Support lockup option to make module un-removable Lucas De Marchi
2014-10-13  4:41           ` Rusty Russell
2014-08-25 10:55 ` [RFC PATCH 5/5] module: Remove stop_machine from module unloading Masami Hiramatsu
2014-10-13  4:40   ` Rusty Russell
2014-10-21 10:34     ` Masami Hiramatsu
2014-10-22  4:25       ` Rusty Russell
2014-10-21 11:27     ` Masami Hiramatsu
2014-09-03  3:11 ` [RFC PATCH 0/5] " Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).