netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Octavian Purdila <opurdila@ixiacom.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, jamal <hadi@cyberus.ca>,
	Daniel Lezcano <dlezcano@fr.ibm.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH
Date: Mon, 30 Nov 2009 11:00:41 -0800	[thread overview]
Message-ID: <m1hbsb7s86.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <200911301408.33297.opurdila@ixiacom.com> (Octavian Purdila's message of "Mon\, 30 Nov 2009 14\:08\:33 +0200")

Octavian Purdila <opurdila@ixiacom.com> writes:

> On Monday 30 November 2009 03:45:58 you wrote:
>
>> +       /* Process any work delayed until the end of the batch */
>> +       dev = list_entry(head->next, struct net_device, unreg_list);
>> +       call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev);
>>  
>> -       list_for_each_entry_safe(dev, aux, head, unreg_list) {
>> -               int new_net = 1;
>> -               list_for_each_entry(fdev, &pernet_list, unreg_list) {
>> -                       if (net_eq(dev_net(dev), dev_net(fdev))) {
>> -                               new_net = 0;
>> -                               dev_put(dev);
>> -                               break;
>> -                       }
>> -               }
>> -               if (new_net)
>> -                       list_move(&dev->unreg_list, &pernet_list);
>> -       }
>> 
>
> This implies that the devices we want to batch unregister needs to be part of 
> the same namespace. It might be worth mentioning that in the 
> unregister_netdevice_many() function comments.

No it does not.  For the route cache flush we have already done the delayed
invalidate per namespace.  So we only need to walk the route cache once and
simply remove the entries that have been invalidated.

For other cases if we really need it, I pass in the first entry of the
unregistration list so we can recover the list if needed.

The implication is that namespaces are not what is important when batching
so it doesn't make sense to turn our list into a pretzel providing information
that is not needed.

> And, fortunately, it seems that all of the current batch unregister users 
> comply with this requirement.

The case I am working on for this patchset is batching of the destruction of
devices across namespace cleanup.  This change reduces my total number of
walks of the route cache from many down to one.

Eric


  reply	other threads:[~2009-11-30 19:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30  1:45 [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH Eric W. Biederman
2009-11-30  1:46 ` [PATCH 07/20] net: Simplify the bond drivers pernet operations Eric W. Biederman
2009-11-30  1:46 ` [PATCH 08/20] net: Simplify vlan " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 09/20] net: Simplify af_key " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 10/20] net: Simplify conntrack_proto_dccp " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 11/20] net: Simplify conntrack_proto_gre " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 12/20] net: Simplify ppp_generic " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 13/20] net: Simplify pppoe " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 14/20] net: Simplify pppol2tp " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 15/20] net: Simplify phonet " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 16/20] net: Simplify ip_gre " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 17/20] net: Simplify ipip " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 18/20] net: Simplify ip6_tunnel " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 19/20] net: Simplify ipip6 aka sit " Eric W. Biederman
2009-11-30  1:46 ` [PATCH 20/20] net: remove [un]register_pernet_gen_... and update the docs Eric W. Biederman
2009-11-30 12:08 ` [PATCH 01/20] net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH Octavian Purdila
2009-11-30 19:00   ` Eric W. Biederman [this message]
2009-11-30 19:25     ` Octavian Purdila
2009-11-30 22:49 ` David Miller
2009-11-30 23:42   ` Eric W. Biederman
2009-11-30 23:55     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1hbsb7s86.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dlezcano@fr.ibm.com \
    --cc=hadi@cyberus.ca \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=opurdila@ixiacom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).