diff mbox series

[v3,2/4] module: Update a comment describing what is protected by module_mutex

Message ID 20221016123031.3963-3-petr.pavlu@suse.com (mailing list archive)
State New, archived
Headers show
Series module: Merge same-name module load requests | expand

Commit Message

Petr Pavlu Oct. 16, 2022, 12:30 p.m. UTC
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
 kernel/module/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

David Hildenbrand Oct. 17, 2022, 7:27 a.m. UTC | #1
On 16.10.22 14:30, Petr Pavlu wrote:
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> ---
>   kernel/module/main.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index a12e177ea81f..5288843ca40f 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -62,10 +62,11 @@
>   
>   /*
>    * Mutex protects:
> - * 1) List of modules (also safely readable with preempt_disable),
> + * 1) list of modules (also safely readable with preempt_disable, delete and add
> + *    uses RCU list operations).
>    * 2) module_use links,
> - * 3) mod_tree.addr_min/mod_tree.addr_max.
> - * (delete and add uses RCU list operations).
> + * 3) mod_tree.addr_min/mod_tree.addr_max,
> + * 4) list of unloaded_tainted_modules.
>    */
>   DEFINE_MUTEX(module_mutex);
>   LIST_HEAD(modules);

Reviewed-by: David Hildenbrand <david@redhat.com>
Petr Mladek Oct. 17, 2022, 12:22 p.m. UTC | #2
On Sun 2022-10-16 14:30:29, Petr Pavlu wrote:

> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> ---
>  kernel/module/main.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index a12e177ea81f..5288843ca40f 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -62,10 +62,11 @@
>  
>  /*
>   * Mutex protects:
> - * 1) List of modules (also safely readable with preempt_disable),
> + * 1) list of modules (also safely readable with preempt_disable, delete and add

This is slightly over 80 characters per line ;-)

It is not reported by checkpatch.pl because the longer line sometimes
makes the code better readable. So people asked to make checkpatch.pl
more relaxed and accept lines < 100. But the 80-characters per-line
rule is still there. It should be honored when it does not make things
visibly worse.

> + *    uses RCU list operations).



>   * 2) module_use links,
> - * 3) mod_tree.addr_min/mod_tree.addr_max.
> - * (delete and add uses RCU list operations).
> + * 3) mod_tree.addr_min/mod_tree.addr_max,
> + * 4) list of unloaded_tainted_modules.

Please, mention that this list can be safely read using RCU.
It is similar to the list of modules.

Also it would be nice to mention the commit 99bd9956551b27cb6f
("module: Introduce module unload taint tracking") in the commit
message. It helps to find the related code. Also this is kind
of a followup fix.

>   */
>  DEFINE_MUTEX(module_mutex);
>  LIST_HEAD(modules);

All the above are minor or cosmetic issues. Feel free to use:

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
diff mbox series

Patch

diff --git a/kernel/module/main.c b/kernel/module/main.c
index a12e177ea81f..5288843ca40f 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -62,10 +62,11 @@ 
 
 /*
  * Mutex protects:
- * 1) List of modules (also safely readable with preempt_disable),
+ * 1) list of modules (also safely readable with preempt_disable, delete and add
+ *    uses RCU list operations).
  * 2) module_use links,
- * 3) mod_tree.addr_min/mod_tree.addr_max.
- * (delete and add uses RCU list operations).
+ * 3) mod_tree.addr_min/mod_tree.addr_max,
+ * 4) list of unloaded_tainted_modules.
  */
 DEFINE_MUTEX(module_mutex);
 LIST_HEAD(modules);