All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Add --wait to modprobe -r
@ 2022-06-03 21:50 Lucas De Marchi
  2022-06-03 21:50 ` [PATCH 1/8] modprobe: Move -R to "Query options" Lucas De Marchi
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Lucas De Marchi @ 2022-06-03 21:50 UTC (permalink / raw)
  To: linux-modules; +Cc: Lucas De Marchi

Keep trying to remove the module if it's failing with EAGAIN. This is an
alternative to

v1: https://lore.kernel.org/linux-modules/20210803202417.462197-1-mcgrof@kernel.org/
v2: https://lore.kernel.org/linux-modules/20210810051602.3067384-1-mcgrof@kernel.org/

The v2 above or variand thereof would be probably a better way, but
unfortunately we can't poll the refcnt file in sysfs to get notified
when it reaches 0. The alternative in v1, with sleep(), uses an arbitrary
interval/maximum. It's not something I'm very  confortable to add to the
library side. So, add a quick implementation in modprobe to allow it
to remove the module and wait up until a maximum timeout. Intention is
to later migrate part of the logic in modprobe to libkmod, including for
example the holders removal recently fixed.

Lucas De Marchi (8):
  modprobe: Move -R to "Query options"
  libkmod: Allow to ignore log message on module removal
  module-playground: Add debugfs entry in mod-simple
  util: Add time-related functions from testsuite
  util: Add msec variants for time-related functions
  util: Add exponential backoff sleep
  testsuite: Add tests for sleep calculation
  modprobe: Add --wait

 libkmod/libkmod-module.c                 | 13 ++--
 libkmod/libkmod.h                        |  2 +
 man/modprobe.xml                         | 17 ++++++
 shared/util.c                            | 72 ++++++++++++++++++++++
 shared/util.h                            | 17 ++++++
 testsuite/module-playground/mod-simple.c | 18 +++++-
 testsuite/test-util.c                    | 41 +++++++++++++
 testsuite/testsuite.c                    | 14 +----
 tools/modprobe.c                         | 76 ++++++++++++++++++++----
 9 files changed, 240 insertions(+), 30 deletions(-)

-- 
2.36.1


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

end of thread, other threads:[~2022-06-27 16:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 21:50 [PATCH 0/8] Add --wait to modprobe -r Lucas De Marchi
2022-06-03 21:50 ` [PATCH 1/8] modprobe: Move -R to "Query options" Lucas De Marchi
2022-06-03 21:50 ` [PATCH 2/8] libkmod: Allow to ignore log message on module removal Lucas De Marchi
2022-06-03 21:50 ` [PATCH 3/8] module-playground: Add debugfs entry in mod-simple Lucas De Marchi
2022-06-03 21:50 ` [PATCH 4/8] util: Add time-related functions from testsuite Lucas De Marchi
2022-06-03 21:50 ` [PATCH 5/8] util: Add msec variants for time-related functions Lucas De Marchi
2022-06-03 21:50 ` [PATCH 6/8] util: Add exponential backoff sleep Lucas De Marchi
2022-06-03 21:50 ` [PATCH 7/8] testsuite: Add tests for sleep calculation Lucas De Marchi
2022-06-03 21:50 ` [PATCH 8/8] modprobe: Add --wait Lucas De Marchi
2022-06-15 16:31 ` [PATCH 0/8] Add --wait to modprobe -r Lucas De Marchi
2022-06-27 16:46   ` Lucas De Marchi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.