Re: [PATCH 5/8] module: Add module_for_each_mod() function
From: Sebastian Andrzej Siewior
Date: Mon Feb 10 2025 - 09:08:27 EST
On 2025-02-10 14:04:35 [+0100], Petr Pavlu wrote:
> >> BTW, do we really need to disable preempt or is it enough to call
> >> rcu_read_lock()?
> >
> > Bah, as I expected this function to be changed, I didn't spend too much
> > time on looking at its implementation. I just cut and pasted how the other
> > loops worked. But yes, it should not be disabling preemption. In fact, I
> > think the module code itself should not be disabling preemption!
> >
> > I'll have to go and look into that.
>
> The series "module: Use RCU instead of RCU-sched" from Sebastian Andrzej
> Siewior cleans this up [1]. It is currently queued on modules-next (for
> 6.15-rc1).
>
> The new function module_for_each_mod() should then use "guard(rcu)();".
So the removal of the preempt-disable statements here already pays off.
Nice.
Sebastian