Re: [PATCH] net: make netdev_wait_allrefs wake-able

2020-09-17 Thread Francesco Ruggeri
On Wed, Sep 16, 2020 at 11:51 PM Eric Dumazet wrote: > > Honestly I would not touch dev_put() at all. > > Simply change the msleep(250) to something better, with maybe > exponential backoff. OK, I will try that. Francesco

Re: [PATCH] net: make netdev_wait_allrefs wake-able

2020-09-17 Thread Eric Dumazet
On Thu, Sep 17, 2020 at 8:33 AM Francesco Ruggeri wrote: > > > static inline void dev_put(struct net_device *dev) > > { > > + struct task_struct *destroy_task = dev->destroy_task; > > + > > this_cpu_dec(*dev->pcpu_refcnt); > > + if (destroy_task) > > +

Re: [PATCH] net: make netdev_wait_allrefs wake-able

2020-09-17 Thread Francesco Ruggeri
> static inline void dev_put(struct net_device *dev) > { > + struct task_struct *destroy_task = dev->destroy_task; > + > this_cpu_dec(*dev->pcpu_refcnt); > + if (destroy_task) > + wake_up_process(destroy_task); > } I just realized that this introduces a race,

[PATCH] net: make netdev_wait_allrefs wake-able

2020-09-16 Thread Francesco Ruggeri
The combination of aca_free_rcu, introduced in commit 2384d02520ff ("net/ipv6: Add anycast addresses to a global hashtable"), and fib6_info_destroy_rcu, introduced in commit 9b0a8da8c4c6 ("net/ipv6: respect rcu grace period before freeing fib6_info"), can result in an extra rcu grace period being