Re: [PATCH] rcuscale: Constify struct rcu_scale_ops

From: Paul E. McKenney

Date: Mon Nov 09 2026 - 13:46:01 EST


On Mon, Nov 09, 2026 at 06:32:15PM +0100, Christophe JAILLET wrote:
> Le 09/11/2026 à 00:06, Joel Fernandes a écrit :
> > On Sat, Nov 07, 2026 at 10:02:25PM +0100, Christophe JAILLET wrote:
> > > 'struct rcu_scale_ops' is not modified in this driver.
> > >
> > > Constifying these structures moves some data to a read-only section, so
> > > increases overall security, especially when the structure holds some
> > > function pointers.
> > >
> > > On a x86_64, with allmodconfig:
> > > Before:
> > > ======
> > > text data bss dec hex filename
> > > 45585 24946 2816 73347 11e83 kernel/rcu/rcuscale.o
> > >
> > > After:
> > > =====
> > > text data bss dec hex filename
> > > 46545 23986 2816 73347 11e83 kernel/rcu/rcuscale.o
> > >
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> > > ---
> > > Compile tested only.
> >
> > rcuscale is a test kernel module, is it worth adding boilerplate for
> > non-production code sighting security reasons?
>
> Oups, now I better understand Bradley Morgan comments.
>
> I didn't notice it was a test module.
> My patch makes no more sense, as it is not hardening runtime, so feel free
> to just drop it.
>
> Sorry for the noise and not seeing it by myself.

Although the header comment does say "Read-Copy Update module-based
scalability-test facility", maybe there is something that should be
done to more clearly mark code that is not to be used in production.
And maybe to inform the LLM review bots of this.

But this is bigger than just RCU.

Thoughts?

Thanx, Paul

> CJ
>
> >
> > Do you mind runtime testing it too if you still feel we should do it (and
> > provide reasons why)?
> >
> > thanks,
> >
> > Joel Fernandes
> >