From: Petr Pavlu <petr.pavlu@suse.com>
To: mcgrof@kernel.org
Cc: pmladek@suse.com, linux-modules@vger.kernel.org,
linux-kernel@vger.kernel.org, Petr Pavlu <petr.pavlu@suse.com>
Subject: [PATCH v2 1/2] module: Correct wake up of module_wq
Date: Mon, 19 Sep 2022 14:32:32 +0200 [thread overview]
Message-ID: <20220919123233.8538-2-petr.pavlu@suse.com> (raw)
In-Reply-To: <20220919123233.8538-1-petr.pavlu@suse.com>
The module_wq wait queue has only non-exclusive waiters and all waits
are interruptible, therefore for consistency use wake_up_interruptible()
to wake its waiters.
Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
kernel/module/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index a4e4d84b6f4e..06cb41c3d2a1 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -763,7 +763,7 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
free_module(mod);
/* someone could wait for the module in add_unformed_module() */
- wake_up_all(&module_wq);
+ wake_up_interruptible(&module_wq);
return 0;
out:
mutex_unlock(&module_mutex);
@@ -2524,7 +2524,7 @@ static noinline int do_init_module(struct module *mod)
schedule_work(&init_free_wq);
mutex_unlock(&module_mutex);
- wake_up_all(&module_wq);
+ wake_up_interruptible(&module_wq);
return 0;
@@ -2540,7 +2540,7 @@ static noinline int do_init_module(struct module *mod)
klp_module_going(mod);
ftrace_release_mod(mod);
free_module(mod);
- wake_up_all(&module_wq);
+ wake_up_interruptible(&module_wq);
return ret;
}
@@ -2886,7 +2886,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
/* Unlink carefully: kallsyms could be walking list. */
list_del_rcu(&mod->list);
mod_tree_remove(mod);
- wake_up_all(&module_wq);
+ wake_up_interruptible(&module_wq);
/* Wait for RCU-sched synchronizing before releasing mod->list. */
synchronize_rcu();
mutex_unlock(&module_mutex);
--
2.35.3
next prev parent reply other threads:[~2022-09-19 12:33 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 12:32 [PATCH v2 0/2] module: Merge same-name module load requests Petr Pavlu
2022-09-19 12:32 ` Petr Pavlu [this message]
2022-09-30 20:22 ` [PATCH v2 1/2] module: Correct wake up of module_wq Luis Chamberlain
2022-10-14 8:40 ` Petr Mladek
2022-09-19 12:32 ` [PATCH v2 2/2] module: Merge same-name module load requests Petr Pavlu
2022-09-30 20:30 ` Luis Chamberlain
2022-10-15 9:27 ` Petr Pavlu
2022-10-18 18:33 ` Luis Chamberlain
2022-10-18 19:19 ` Prarit Bhargava
2022-10-18 19:53 ` Prarit Bhargava
2022-10-20 7:19 ` Petr Mladek
2022-10-24 13:22 ` Prarit Bhargava
2022-10-24 17:08 ` Luis Chamberlain
2022-10-24 12:37 ` Petr Pavlu
2022-10-24 14:00 ` Prarit Bhargava
2022-11-13 16:44 ` Petr Pavlu
2022-10-19 12:00 ` Petr Pavlu
2022-10-20 7:03 ` Petr Mladek
2022-10-24 17:53 ` Luis Chamberlain
2022-11-12 1:47 ` Luis Chamberlain
2022-11-14 8:57 ` David Hildenbrand
2022-11-14 15:38 ` Luis Chamberlain
2022-11-14 15:45 ` David Hildenbrand
2022-11-15 19:29 ` Luis Chamberlain
2022-11-16 16:03 ` Prarit Bhargava
2022-11-21 16:00 ` Petr Pavlu
2022-11-21 19:03 ` Luis Chamberlain
2022-11-21 19:50 ` David Hildenbrand
2022-11-21 20:27 ` Luis Chamberlain
2022-11-22 13:59 ` Petr Pavlu
2022-11-22 17:58 ` Luis Chamberlain
2022-11-16 16:04 ` David Hildenbrand
2022-11-18 17:32 ` David Hildenbrand
2022-11-28 16:29 ` Prarit Bhargava
2022-11-29 13:13 ` Petr Pavlu
2022-12-02 16:36 ` Petr Mladek
2022-12-06 12:31 ` Prarit Bhargava
2022-12-07 13:23 ` Petr Pavlu
2022-12-04 19:58 ` Prarit Bhargava
2022-10-14 7:54 ` David Hildenbrand
2022-10-15 9:49 ` Petr Pavlu
2022-10-14 13:52 ` Petr Mladek
2022-10-16 12:25 ` Petr Pavlu
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=20220919123233.8538-2-petr.pavlu@suse.com \
--to=petr.pavlu@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=pmladek@suse.com \
/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