[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e652a11e-b23d-4a83-aaac-00c469a416f1@email.android.com>
Date: Tue, 17 Sep 2013 16:41:37 -0700
From: "Eric W. Biederman" <ebiederm@...ssion.com>
To: David Miller <davem@...emloft.net>
CC: fruggeri@...stanetworks.com, edumazet@...gle.com, jiri@...nulli.us,
alexander.h.duyck@...el.com, amwang@...hat.com,
netdev@...r.kernel.org
Subject: Re: [CFT][PATCH] net: Delay default_device_exit_batch until no devices are unregistering
David Miller <davem@...emloft.net> wrote:
>From: ebiederm@...ssion.com (Eric W. Biederman)
>Date: Mon, 16 Sep 2013 20:49:31 -0700
>
>> /* Delayed registration/unregisteration */
>> static LIST_HEAD(net_todo_list);
>> +static atomic_t netdev_unregistering = ATOMIC_INIT(0);
>> +static DECLARE_WAIT_QUEUE_HEAD(netdev_unregistering_wait);
>
>I think you don't need this atomic.
>
>Something like this should work and seems much simpler:
>
>1) Still use the netdev_unregistering_wait queue, that's fine.
>
>2) In netdev_run_todo(), unconditionally wake it up at the end of
> the while() loop.
>
>3) In default_device_exit_batch() use the same retry logic but
> your tests are on list_empty(&net_todo_list() rather than the
> new atomic count.
List/count I don't much care but currently we don't have a list of all of the devices that are unregistering.
The problem with this is that netdev_run_todo moves all of the devices to a local list, so they are only visible from a list_head on the stack. Which makes sense as we run this all in the context of rtnl_unlock.
>I think with this simplification I'm fine to apply this patch after
>it has been tested properly.
I wish we could make that simplication.
>Long term I'd like to see a per-namespace todo list, as seems to
>have been suggested and discussed already.
Eric
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists