On Fri, Jun 9, 2017 at 11:05 AM, Xin Long <lucien....@gmail.com> wrote: > On Sat, Jun 10, 2017 at 1:01 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> This is what I thought in my first response, until I realized >> it is not pure RCU, otherwise pmc->lock should not be taken >> in igmpv3_send_cr(). It seems the code is mixing the use >> of spinlock and RCU. > rcu lock is for pmc not being freed, and spinlock is for pmc's > members' modification. is there some rule these two locks > should be mixed? >
This is exactly why I said we are mixing RCU and spinlock. > >> >> We need RCU anyway, ip_check_mc_rcu() is the real fast >> path where we don't take spinlock. I think we will need more >> work. > It seems all add_grec() callings needs spinlock, maybe add_grec > modifies pmc's member. it's hard to drop spinlock. > > from ip_check_mc_rcu you mentioned about, it should be right > to call ip_mc_clear_src after rcu grace period, like Eric's patch. Well, more than just that, we need to use proper RCU API for pmc->sources and you know it is a singly linked list... I will work on this.