Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1353056 > unrolled thread
| Started by | Michal Kubecek <mkubecek@suse.cz> |
|---|---|
| First post | 2016-03-08 14:50 +0100 |
| Last post | 2016-03-08 19:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH net-next v2 3/3] ipv6: per netns FIB garbage collection Michal Kubecek <mkubecek@suse.cz> - 2016-03-08 14:50 +0100
Re: [PATCH net-next v2 3/3] ipv6: per netns FIB garbage collection Cong Wang <xiyou.wangcong@gmail.com> - 2016-03-08 19:40 +0100
| From | Michal Kubecek <mkubecek@suse.cz> |
|---|---|
| Date | 2016-03-08 14:50 +0100 |
| Subject | [PATCH net-next v2 3/3] ipv6: per netns FIB garbage collection |
| Message-ID | <raqbp-1xM-31@gated-at.bofh.it> |
One of our customers observed issues with FIB6 garbage collectors
running in different network namespaces blocking each other, resulting
in soft lockups (fib6_run_gc() initiated from timer runs always in
forced mode).
Now that FIB6 walkers are separated per namespace, there is no more need
for instances of fib6_run_gc() in different namespaces blocking each
other. There is still a call to icmp6_dst_gc() which operates on shared
data but this function is protected by its own shared lock.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
include/net/netns/ipv6.h | 1 +
net/ipv6/ip6_fib.c | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index f0109b973648..10d0848f5b8a 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -61,6 +61,7 @@ struct netns_ipv6 {
struct list_head fib6_walkers;
struct dst_ops ip6_dst_ops;
rwlock_t fib6_walker_lock;
+ spinlock_t fib6_gc_lock;
unsigned int ip6_rt_gc_expire;
unsigned long ip6_rt_last_gc;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 883f2836beab..ea071fad67a0 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1776,16 +1776,14 @@ static int fib6_age(struct rt6_info *rt, void *arg)
return 0;
}
-static DEFINE_SPINLOCK(fib6_gc_lock);
-
void fib6_run_gc(unsigned long expires, struct net *net, bool force)
{
struct fib6_gc_args gc_args;
unsigned long now;
if (force) {
- spin_lock_bh(&fib6_gc_lock);
- } else if (!spin_trylock_bh(&fib6_gc_lock)) {
+ spin_lock_bh(&net->ipv6.fib6_gc_lock);
+ } else if (!spin_trylock_bh(&net->ipv6.fib6_gc_lock)) {
mod_timer(&net->ipv6.ip6_fib_timer, jiffies + HZ);
return;
}
@@ -1804,7 +1802,7 @@ void fib6_run_gc(unsigned long expires, struct net *net, bool force)
+ net->ipv6.sysctl.ip6_rt_gc_interval));
else
del_timer(&net->ipv6.ip6_fib_timer);
- spin_unlock_bh(&fib6_gc_lock);
+ spin_unlock_bh(&net->ipv6.fib6_gc_lock);
}
static void fib6_gc_timer_cb(unsigned long arg)
@@ -1816,6 +1814,7 @@ static int __net_init fib6_net_init(struct net *net)
{
size_t size = sizeof(struct hlist_head) * FIB6_TABLE_HASHSZ;
+ spin_lock_init(&net->ipv6.fib6_gc_lock);
rwlock_init(&net->ipv6.fib6_walker_lock);
INIT_LIST_HEAD(&net->ipv6.fib6_walkers);
setup_timer(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, (unsigned long)net);
--
2.7.2
[toc] | [next] | [standalone]
| From | Cong Wang <xiyou.wangcong@gmail.com> |
|---|---|
| Date | 2016-03-08 19:40 +0100 |
| Message-ID | <rauI1-4Kx-5@gated-at.bofh.it> |
| In reply to | #1353056 |
On Tue, Mar 8, 2016 at 5:44 AM, Michal Kubecek <mkubecek@suse.cz> wrote: > One of our customers observed issues with FIB6 garbage collectors > running in different network namespaces blocking each other, resulting > in soft lockups (fib6_run_gc() initiated from timer runs always in > forced mode). > > Now that FIB6 walkers are separated per namespace, there is no more need > for instances of fib6_run_gc() in different namespaces blocking each > other. There is still a call to icmp6_dst_gc() which operates on shared > data but this function is protected by its own shared lock. > > Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web