Re: [PATCH 1/2] ipv6: do not hold route table lock when send ndisc probe
From: Cong Wang <hidden>
Date: 2012-08-24 09:15:42
On Thu, 2012-08-23 at 18:10 +0200, Eric Dumazet wrote:
On Tue, 2012-08-21 at 11:44 +0800, Cong Wang wrote:quoted
Hi, Debabrata, Could you help to test the attached patch below? Thanks!Hard to comment on your patch since its not inlined. + nw = kmalloc(sizeof(*nw), GFP_ATOMIC); + if (nw) { + memcpy(&nw->target, &neigh->primary_key, sizeof(struct in6_addr)); + addrconf_addr_solict_mult(&nw->target, &nw->mcaddr); + nw->dev = rt->dst.dev; + INIT_WORK(&nw->work, queue_ndisc); + schedule_work(&nw->work); + } You cant do that without taking extra reference on dev, and release it in queue_ndisc() This also will add interesting side effects at device dismantle.
Right... If we call dev_hold() in the work, it is possible that the work is still not scheduled to running when we unregister the device. What's more, we can't flush work here as we are holding a read lock. Hmm.