From: Sorin Dumitru <sorin@returnze.ro>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Sorin Dumitru <sorin@returnze.ro>,
Sorin Dumitru <sdumitru@ixiacom.com>
Subject: [PATCH net-next] vxlan: release lock after each bucket in vxlan_cleanup
Date: Tue, 26 May 2015 10:42:04 +0300 [thread overview]
Message-ID: <1432626124-24676-1-git-send-email-sorin@returnze.ro> (raw)
We're seeing some softlockups from this function when there
are a lot fdb entries on a vxlan device. Taking the lock for
each bucket instead of the whole table is enough to fix that.
Signed-off-by: Sorin Dumitru <sdumitru@ixiacom.com>
---
drivers/net/vxlan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 5eddbc0..34c519e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2131,9 +2131,10 @@ static void vxlan_cleanup(unsigned long arg)
if (!netif_running(vxlan->dev))
return;
- spin_lock_bh(&vxlan->hash_lock);
for (h = 0; h < FDB_HASH_SIZE; ++h) {
struct hlist_node *p, *n;
+
+ spin_lock_bh(&vxlan->hash_lock);
hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) {
struct vxlan_fdb *f
= container_of(p, struct vxlan_fdb, hlist);
@@ -2152,8 +2153,8 @@ static void vxlan_cleanup(unsigned long arg)
} else if (time_before(timeout, next_timer))
next_timer = timeout;
}
+ spin_unlock_bh(&vxlan->hash_lock);
}
- spin_unlock_bh(&vxlan->hash_lock);
mod_timer(&vxlan->age_timer, next_timer);
}
--
2.4.1
next reply other threads:[~2015-05-26 7:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 7:42 Sorin Dumitru [this message]
2015-05-27 17:33 ` [PATCH net-next] vxlan: release lock after each bucket in vxlan_cleanup David Miller
2015-05-27 17:44 ` Cong Wang
2015-05-27 18:09 ` Sorin Dumitru
2015-05-27 18:31 ` 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=1432626124-24676-1-git-send-email-sorin@returnze.ro \
--to=sorin@returnze.ro \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sdumitru@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).