Re: [PATCH net 3/3] net/sched: taprio: dereference oper and admin sched under RCU in taprio_destroy

From: Vladimir Oltean
Date: Wed Sep 14 2022 - 17:54:09 EST


On Wed, Sep 14, 2022 at 05:34:39PM +0300, Vladimir Oltean wrote:
> - if (q->oper_sched)
> - call_rcu(&q->oper_sched->rcu, taprio_free_sched_cb);
> + rcu_read_lock();
> +
> + oper = rcu_dereference(q->oper_sched);
> + admin = rcu_dereference(q->admin_sched);
> +
> + if (oper)
> + call_rcu(&oper->rcu, taprio_free_sched_cb);
>
> - if (q->admin_sched)
> - call_rcu(&q->admin_sched->rcu, taprio_free_sched_cb);
> + if (admin)
> + call_rcu(&admin->rcu, taprio_free_sched_cb);
> +
> + rcu_read_unlock();
> }

I decided to code up this patch at the last minute, since the sparse
warning was bugging me. But after more testing (including with lockdep,
which says absolutely nothing), I notice some RCU stalls after this
patch. It looks like call_rcu() really doesn't like to be called under
rcu_read_lock(). Please discard this patch set from patchwork, I'll
resend when things will work properly.