Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:33 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:33 +0100
commit07f6645c697cc1c94e80247ce93033ea770b7e66 (patch)
tree07ba65a0cbda0f7a5c4aef88955579822be72895
parent7e7aa51b485fc0e0274a76ad9a3000a6182bfc02 (diff)
tcp: batch tcp_net_metrics_exit (bsc#1122982).
-rw-r--r--patches.fixes/tcp-batch-tcp_net_metrics_exit.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.fixes/tcp-batch-tcp_net_metrics_exit.patch b/patches.fixes/tcp-batch-tcp_net_metrics_exit.patch
new file mode 100644
index 0000000000..68723e0b3a
--- /dev/null
+++ b/patches.fixes/tcp-batch-tcp_net_metrics_exit.patch
@@ -0,0 +1,55 @@
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 19 Sep 2017 16:27:07 -0700
+Subject: tcp: batch tcp_net_metrics_exit
+Patch-mainline: v4.15-rc1
+Git-commit: 789e6ddb0b2fb5d5024b760b178a47876e4de7a6
+References: bsc#1122982
+
+When dealing with a list of dismantling netns, we can scan
+tcp_metrics once, saving cpu cycles.
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ net/ipv4/tcp_metrics.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+--- a/net/ipv4/tcp_metrics.c
++++ b/net/ipv4/tcp_metrics.c
+@@ -892,10 +892,14 @@ static void tcp_metrics_flush_all(struct net *net)
+
+ for (row = 0; row < max_rows; row++, hb++) {
+ struct tcp_metrics_block __rcu **pp;
++ bool match;
++
+ spin_lock_bh(&tcp_metrics_lock);
+ pp = &hb->chain;
+ for (tm = deref_locked(*pp); tm; tm = deref_locked(*pp)) {
+- if (net_eq(tm_net(tm), net)) {
++ match = net ? net_eq(tm_net(tm), net) :
++ !atomic_read(&tm_net(tm)->count);
++ if (match) {
+ *pp = tm->tcpm_next;
+ kfree_rcu(tm, rcu_head);
+ } else {
+@@ -1018,14 +1022,14 @@ static int __net_init tcp_net_metrics_init(struct net *net)
+ return 0;
+ }
+
+-static void __net_exit tcp_net_metrics_exit(struct net *net)
++static void __net_exit tcp_net_metrics_exit_batch(struct list_head *net_exit_list)
+ {
+- tcp_metrics_flush_all(net);
++ tcp_metrics_flush_all(NULL);
+ }
+
+ static __net_initdata struct pernet_operations tcp_net_metrics_ops = {
+- .init = tcp_net_metrics_init,
+- .exit = tcp_net_metrics_exit,
++ .init = tcp_net_metrics_init,
++ .exit_batch = tcp_net_metrics_exit_batch,
+ };
+
+ void __init tcp_metrics_init(void)
diff --git a/series.conf b/series.conf
index 2e1a73d1c2..91725cba5f 100644
--- a/series.conf
+++ b/series.conf
@@ -8767,6 +8767,7 @@
patches.fixes/kobject-copy-env-blob-in-one-go.patch
patches.fixes/kobject-factorize-skb-setup-in-kobject_uevent_net_br.patch
patches.fixes/ipv6-addrlabel-per-netns-list.patch
+ patches.fixes/tcp-batch-tcp_net_metrics_exit.patch
patches.drivers/cxgb4-add-new-T5-pci-device-id-s-34929cb4.patch
patches.drivers/drivers-net-e1000e-use-setup_timer-helper.patch
patches.drivers/drivers-net-bnxt-use-setup_timer-helper.patch