Re: [PATCH RFC tip/core/rcu] Add shrinker to shift to fast/inefficient GP mode

From: Paul E. McKenney
Date: Fri May 08 2020 - 10:47:21 EST


On Fri, May 08, 2020 at 09:37:43PM +0800, Hillf Danton wrote:
>
> On Thu, 7 May 2020 08:49:10 Paul E. McKenney wrote:
> >
> > > +static void rcu_mph_info(void *data)
> >
> > This pointer will always be &rcu_state, so why not ignore the pointer
> > and use "rcu_state" below?
> >
> Yes you're right.
>
> > RCU grace periods are inherently global, so I don't know of any way
> > for RCU to focus on a given NUMA node. All or nothing.
>
> Or is it feasible to expose certain RCU thing to VM, say, with which kswapd
> can kick grace period every time the kthreads think it's needed? That way
> the work to gauge memory pressure can be off RCU's shoulders.

A pair of functions RCU provides is easy for me. ;-)

Thanx, Paul

> > But on the
> > other hand, speeding up RCU grace periods will also help specific
> > NUMA nodes, so I believe that it is all good.
> >
> > > +{
> > > + struct rcu_state *state = data;
> > > +
> > > + WRITE_ONCE(state->mph_end, jiffies + HZ / 10);
> > > + smp_store_release(&state->mph, true);
> > > + rcu_force_quiescent_state();
> > > +}
> > > +
> > > +static struct mph_subscriber rcu_mph_subscriber = {
> > > + .info = rcu_mph_info,
> > > + .data = &rcu_state,
> >
> > Then this ".data" entry can be omitted, correct?
>
> Yes :)
>
> Hillf
>