net: Make cleanup_list and net::cleanup_list of llist type

This simplifies cleanup queueing and makes cleanup lists
to use llist primitives. Since llist has its own cmpxchg()
ordering, cleanup_list_lock is not more need.

Also, struct llist_node is smaller, than struct list_head,
so we save some bytes in struct net with this patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kirill Tkhai
2018-02-19 12:58:45 +03:00
committed by David S. Miller
parent 19efbd93e6
commit 65b7b5b90f
2 changed files with 8 additions and 15 deletions

View File

@@ -59,12 +59,13 @@ struct net {
atomic64_t cookie_gen;
struct list_head list; /* list of network namespaces */
struct list_head cleanup_list; /* namespaces on death row */
struct list_head exit_list; /* To linked to call pernet exit
* methods on dead net (net_sem
* read locked), or to unregister
* pernet ops (net_sem wr locked).
*/
struct llist_node cleanup_list; /* namespaces on death row */
struct user_namespace *user_ns; /* Owning user namespace */
struct ucounts *ucounts;
spinlock_t nsid_lock;