Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[NETFILTER]: More __read_mostly annotations

Place rarely written variables in the read-mostly section by using
__read_mostly

Signed-off-by: Martin Josefsson <gandalf@wlug.westbo.se>
Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Martin Josefsson and committed by
David S. Miller
e2b7606c 8f03dea5

+5 -5
+2 -2
net/netfilter/core.c
··· 28 28 29 29 static DEFINE_SPINLOCK(afinfo_lock); 30 30 31 - struct nf_afinfo *nf_afinfo[NPROTO]; 31 + struct nf_afinfo *nf_afinfo[NPROTO] __read_mostly; 32 32 EXPORT_SYMBOL(nf_afinfo); 33 33 34 34 int nf_register_afinfo(struct nf_afinfo *afinfo) ··· 54 54 * of skbuffs queued for userspace, and not deregister a hook unless 55 55 * this is zero, but that sucks. Now, we simply check when the 56 56 * packets come back: if the hook is gone, the packet is discarded. */ 57 - struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 57 + struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS] __read_mostly; 58 58 EXPORT_SYMBOL(nf_hooks); 59 59 static DEFINE_SPINLOCK(nf_hook_lock); 60 60
+2 -2
net/netfilter/nf_conntrack_core.c
··· 73 73 atomic_t nf_conntrack_count = ATOMIC_INIT(0); 74 74 75 75 void (*nf_conntrack_destroyed)(struct nf_conn *conntrack) = NULL; 76 - unsigned int nf_conntrack_htable_size __read_mostly = 0; 76 + unsigned int nf_conntrack_htable_size __read_mostly; 77 77 int nf_conntrack_max __read_mostly; 78 78 struct list_head *nf_conntrack_hash __read_mostly; 79 - struct nf_conn nf_conntrack_untracked; 79 + struct nf_conn nf_conntrack_untracked __read_mostly; 80 80 unsigned int nf_ct_log_invalid __read_mostly; 81 81 LIST_HEAD(unconfirmed); 82 82 static int nf_conntrack_vmalloc __read_mostly;
+1 -1
net/netfilter/nf_conntrack_helper.c
··· 30 30 #include <net/netfilter/nf_conntrack_helper.h> 31 31 #include <net/netfilter/nf_conntrack_core.h> 32 32 33 - static LIST_HEAD(helpers); 33 + static __read_mostly LIST_HEAD(helpers); 34 34 35 35 struct nf_conntrack_helper * 36 36 __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple)