[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <151903433442.8021.12730991801718645322.stgit@localhost.localdomain>
Date: Mon, 19 Feb 2018 12:58:54 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: davem@...emloft.net, nicolas.dichtel@...nd.com,
vyasevic@...hat.com, ktkhai@...tuozzo.com,
paulmck@...ux.vnet.ibm.com, vyasevich@...il.com,
mark.rutland@....com, gregkh@...uxfoundation.org,
leonro@...lanox.com, avagin@...tuozzo.com, fw@...len.de,
roman.kapl@...go.com, netdev@...r.kernel.org
Subject: [PATCH 3/3] net: Queue net_cleanup_work only if there is first net
added
When llist_add() returns false, cleanup_net() hasn't made its
llist_del_all(), while the work has already been scheduled
by the first queuer. So, we may skip queue_work() in this case.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
net/core/net_namespace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index abf8a46e94e2..27a55236ad64 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -582,8 +582,8 @@ static DECLARE_WORK(net_cleanup_work, cleanup_net);
void __put_net(struct net *net)
{
/* Cleanup the network namespace in process context */
- llist_add(&net->cleanup_list, &cleanup_list);
- queue_work(netns_wq, &net_cleanup_work);
+ if (llist_add(&net->cleanup_list, &cleanup_list))
+ queue_work(netns_wq, &net_cleanup_work);
}
EXPORT_SYMBOL_GPL(__put_net);
Powered by blists - more mailing lists