]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: make kmem caches as __ro_after_init
authorAlexey Dobriyan <adobriyan@gmail.com>
Sat, 24 Feb 2018 18:20:33 +0000 (21:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Feb 2018 20:11:48 +0000 (15:11 -0500)
All kmem caches aren't reallocated once set up.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net_namespace.c
net/core/skbuff.c
net/ipv4/fib_trie.c
net/ipv4/inetpeer.c
net/ipv4/ipmr.c
net/socket.c

index 27a55236ad64fda06723af58eec66e3efb244f2d..690e78c6af4576e147a0a1b7bb9a24592d46f729 100644 (file)
@@ -362,7 +362,7 @@ static void dec_net_namespaces(struct ucounts *ucounts)
        dec_ucount(ucounts, UCOUNT_NET_NAMESPACES);
 }
 
-static struct kmem_cache *net_cachep;
+static struct kmem_cache *net_cachep __ro_after_init;
 static struct workqueue_struct *netns_wq;
 
 static struct net *net_alloc(void)
index 1a7485a2cdfa8dd72605a09722c21b02f77106bc..96d36b81a3a5b4d1a0a0ae4e1610870dcca0e837 100644 (file)
@@ -77,8 +77,8 @@
 #include <linux/capability.h>
 #include <linux/user_namespace.h>
 
-struct kmem_cache *skbuff_head_cache __read_mostly;
-static struct kmem_cache *skbuff_fclone_cache __read_mostly;
+struct kmem_cache *skbuff_head_cache __ro_after_init;
+static struct kmem_cache *skbuff_fclone_cache __ro_after_init;
 int sysctl_max_skb_frags __read_mostly = MAX_SKB_FRAGS;
 EXPORT_SYMBOL(sysctl_max_skb_frags);
 
index 5530cd6fdbc7d44dc259653e0b26d2065d007f1b..62243a8abf92a58b7932a259c15f94bca3b8560d 100644 (file)
@@ -50,6 +50,7 @@
 
 #define VERSION "0.409"
 
+#include <linux/cache.h>
 #include <linux/uaccess.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
@@ -191,8 +192,8 @@ static size_t tnode_free_size;
  */
 static const int sync_pages = 128;
 
-static struct kmem_cache *fn_alias_kmem __read_mostly;
-static struct kmem_cache *trie_leaf_kmem __read_mostly;
+static struct kmem_cache *fn_alias_kmem __ro_after_init;
+static struct kmem_cache *trie_leaf_kmem __ro_after_init;
 
 static inline struct tnode *tn_info(struct key_vector *kv)
 {
index 914d56928578c6251c9e4b03c5e8523e8dd31184..1f04bd91fc2e999ddb82f4be92d39d229166b691 100644 (file)
@@ -6,6 +6,7 @@
  *  Authors:   Andrey V. Savochkin <saw@msu.ru>
  */
 
+#include <linux/cache.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -51,7 +52,7 @@
  *             daddr: unchangeable
  */
 
-static struct kmem_cache *peer_cachep __read_mostly;
+static struct kmem_cache *peer_cachep __ro_after_init;
 
 void inet_peer_base_init(struct inet_peer_base *bp)
 {
index 7c7ac9d32e77961a4fa7b5a4a05fe785b6a6810d..591d1fc80a1f6af39a7444ac7505b729c2cff8d9 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <linux/uaccess.h>
 #include <linux/types.h>
+#include <linux/cache.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
@@ -96,7 +97,7 @@ static DEFINE_SPINLOCK(mfc_unres_lock);
  * In this case data path is free of exclusive locks at all.
  */
 
-static struct kmem_cache *mrt_cachep __read_mostly;
+static struct kmem_cache *mrt_cachep __ro_after_init;
 
 static struct mr_table *ipmr_new_table(struct net *net, u32 id);
 static void ipmr_free_table(struct mr_table *mrt);
index ab58e57c09caeaf0e26e03aefc83594ac7d61938..645d32b4872cb5d88fbb993b71178a1b30fb4e2b 100644 (file)
@@ -233,7 +233,7 @@ static int move_addr_to_user(struct sockaddr_storage *kaddr, int klen,
        return __put_user(klen, ulen);
 }
 
-static struct kmem_cache *sock_inode_cachep __read_mostly;
+static struct kmem_cache *sock_inode_cachep __ro_after_init;
 
 static struct inode *sock_alloc_inode(struct super_block *sb)
 {