[PATCH 04/13] module: use RCU to synchronize find_module

2021-02-02 Thread Christoph Hellwig
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Signed-off-by: Christoph Hellwig Reviewed-by: Petr Mladek Acked-by:

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-02-01 Thread Miroslav Benes
On Mon, 1 Feb 2021, Jessica Yu wrote: > +++ Miroslav Benes [29/01/21 16:29 +0100]: > >On Thu, 28 Jan 2021, Christoph Hellwig wrote: > > > >> Allow for a RCU-sched critical section around find_module, following > >> the lower level find_module_all helper, and switch the two callers > >> outside of

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-02-01 Thread Jessica Yu
+++ Miroslav Benes [29/01/21 16:29 +0100]: On Thu, 28 Jan 2021, Christoph Hellwig wrote: Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-02-01 Thread Christoph Hellwig
On Fri, Jan 29, 2021 at 04:29:02PM +0100, Miroslav Benes wrote: > > > > - mutex_lock(_mutex); > > + rcu_read_lock_sched(); > > /* > > * We do not want to block removal of patched modules and therefore > > * we do not take a reference here. The patches are removed by > > @@

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-29 Thread Thiago Jung Bauermann
Christoph Hellwig writes: > On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: >> > struct module *find_module(const char *name) >> > { >> > - module_assert_mutex(); >> >> Does it make sense to replace the assert above with the warn below >> (untested)? >> >>

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-29 Thread Petr Mladek
On Thu 2021-01-28 19:14:12, Christoph Hellwig wrote: > Allow for a RCU-sched critical section around find_module, following > the lower level find_module_all helper, and switch the two callers > outside of module.c to use such a RCU-sched critical section instead > of module_mutex. > >

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Christoph Hellwig
On Thu, Jan 28, 2021 at 05:50:56PM -0300, Thiago Jung Bauermann wrote: > > struct module *find_module(const char *name) > > { > > - module_assert_mutex(); > > Does it make sense to replace the assert above with the warn below (untested)? > > RCU_LOCKDEP_WARN(rcu_read_lock_sched_held());

Re: [PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Thiago Jung Bauermann
Hi Christoph, Christoph Hellwig writes: > diff --git a/kernel/module.c b/kernel/module.c > index 981302f616b411..6772fb2680eb3e 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -668,7 +668,6 @@ static struct module *find_module_all(const char *name, > size_t len, > > struct

[PATCH 04/13] module: use RCU to synchronize find_module

2021-01-28 Thread Christoph Hellwig
Allow for a RCU-sched critical section around find_module, following the lower level find_module_all helper, and switch the two callers outside of module.c to use such a RCU-sched critical section instead of module_mutex. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2 +-