On Tue, 2016-08-30 at 07:57 -0400, Jamal Hadi Salim wrote:
> rcu_assign_pointer(d->skbmod_p, p);
> if (ovr) {
> spin_unlock_bh(&d->tcf_lock);
> synchronize_rcu();
> }
>
> kfree(p_old);
Overall patch looks good Jamal, thanks.
synchronize_rcu() might bee to expensive if you plan to change actions
hundred of times per second.
You could instead add a 'struct rcu_head rcu;' field in struct
tcf_skbmod_params (but make sure this is not exported to user space)
Then :
if (ovr)
spin_unlock_bh(&d->tcf_lock);
kfree_rcu(p_old, rcu);