public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: nicolas.dichtel@6wind.com
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH] ipv4: release dev refcnt early when destroying inetdev
Date: Fri, 10 Sep 2010 16:24:39 +0200	[thread overview]
Message-ID: <1284128679.24675.38.camel@edumazet-laptop> (raw)
In-Reply-To: <4C8A3430.2070105@6wind.com>

Le vendredi 10 septembre 2010 à 15:35 +0200, Nicolas Dichtel a écrit :
> Hi all,
> 
> We got a scalability problem when we try to remove a lot of virtual interfaces. 
> After analysis, we found that a refcnt on a device was released too late.
> Here is a proposal patch. If we are not missing something, the refcnt can be 
> release before call_rcu(). In IPv6, this is already the case.
> 
> Comments are welcome.
> 
> 
> Regards,
> Nicolas
> pièce jointe différences entre fichiers
> (0001-ipv4-release-dev-refcnt-early-when-destroying-inetd.patch)
> From 6fe291ff56b1f94599dfaa57dfb0ed4c168b603f Mon Sep 17 00:00:00 2001
> From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Date: Fri, 10 Sep 2010 14:52:15 +0200
> Subject: [PATCH] ipv4: release dev refcnt early when destroying inetdev
> 
> When a virtual device is removed, refcnt on dev is released
> after rcu barrier, hence we fall always in the msleep(250)
> of netdev_wait_allrefs(). This causes a long delay when
> a lot of interfaces are removed.
> Refcnt can be released before this rcu barrier, this allows
> to accelerate the removing of virtual interfaces.
> 
> Test of removing 50 ipip tunnel interfaces:
>  Before the patch:
>   real    0m12.804s
>   user    0m0.020s
>   sys     0m0.000s
> 
>  After the patch:
>   real    0m0.988s
>   user    0m0.004s
>   sys     0m0.016s
> 
> Signed-off-by: Wang Xuefu <xuefu.wang@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---

This is a well known problem, (many patches were sent some months ago)
but your patch is not the right solution.

As long as the idev is not yet freed, it can be used and we need to
access idev->dev




  reply	other threads:[~2010-09-10 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 13:35 [RFC PATCH] ipv4: release dev refcnt early when destroying inetdev Nicolas Dichtel
2010-09-10 14:24 ` Eric Dumazet [this message]
2010-09-10 14:57   ` Nicolas Dichtel
2010-09-10 15:16     ` Eric Dumazet
2010-09-14 20:45       ` David Miller
2010-09-15  6:01         ` Eric Dumazet
2010-09-13 22:24   ` [PATCH] net: use rcu_barrier() in rollback_registered_many Eric Dumazet
2010-09-14 21:27     ` 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=1284128679.24675.38.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.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