make some netfilter globals __read_mostly
Subsystems (3)
PATCH 1/1 make some netfilter globals __read_mostly
Make some netfilter globals __read_mostly at the request of Patrick McHardy.
Signed-off-by Brian Haley <[email protected]>
net/ipv4/netfilter/ip_conntrack_core.c +3 -3
@@ -64,17 +64,17 @@ atomic_t ip_conntrack_count = ATOMIC_INIvoid (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack) =NULL ;LIST_HEAD (ip_conntrack_expect_list); -struct ip_conntrack_protocol *ip_ct_protos[MAX_IP_CT_PROTO ]; +struct ip_conntrack_protocol *ip_ct_protos[MAX_IP_CT_PROTO ]__read_mostly ;static LIST_HEAD (helpers);unsigned int ip_conntrack_htable_size =0 ;int ip_conntrack_max; -struct list_head *ip_conntrack_hash; +struct list_head *ip_conntrack_hash__read_mostly ;static kmem_cache_t *ip_conntrack_cachep__read_mostly ;static kmem_cache_t *ip_conntrack_expect_cachep__read_mostly ;struct ip_conntrack ip_conntrack_untracked;unsigned int ip_ct_log_invalid;static LIST_HEAD (unconfirmed); -static int ip_conntrack_vmalloc; +static int ip_conntrack_vmalloc__read_mostly ;static unsigned int ip_conntrack_next_id;static unsigned int ip_conntrack_expect_next_id;
net/ipv4/netfilter/ip_queue.c +4 -4
@@ -52,15 +52,15 @@ struct ipq_queue_entry {typedef int (*ipq_cmpfn )(struct ipq_queue_entry *,unsigned long ); -static unsigned char copy_mode =IPQ_COPY_NONE ; +static unsigned char copy_mode__read_mostly =IPQ_COPY_NONE ;static unsigned int queue_maxlen =IPQ_QMAX_DEFAULT ;static DEFINE_RWLOCK (queue_lock); -static int peer_pid; -static unsigned int copy_range; +static int peer_pid__read_mostly ; +static unsigned int copy_range__read_mostly ;static unsigned int queue_total;static unsigned int queue_dropped =0 ;static unsigned int queue_user_dropped =0 ; -static struct sock *ipqnl; +static struct sock *ipqnl__read_mostly ;static LIST_HEAD (queue_list);static DEFINE_MUTEX (ipqnl_mutex);
net/ipv6/netfilter/ip6_queue.c +4 -4
@@ -56,15 +56,15 @@ struct ipq_queue_entry {typedef int (*ipq_cmpfn )(struct ipq_queue_entry *,unsigned long ); -static unsigned char copy_mode =IPQ_COPY_NONE ; +static unsigned char copy_mode__read_mostly =IPQ_COPY_NONE ;static unsigned int queue_maxlen =IPQ_QMAX_DEFAULT ;static DEFINE_RWLOCK (queue_lock); -static int peer_pid; -static unsigned int copy_range; +static int peer_pid__read_mostly ; +static unsigned int copy_range__read_mostly ;static unsigned int queue_total;static unsigned int queue_dropped =0 ;static unsigned int queue_user_dropped =0 ; -static struct sock *ipqnl; +static struct sock *ipqnl__read_mostly ;static LIST_HEAD (queue_list);static DEFINE_MUTEX (ipqnl_mutex);
net/netfilter/nf_conntrack_core.c +5 -5
@@ -74,17 +74,17 @@ atomic_t nf_conntrack_count = ATOMIC_INIvoid (*nf_conntrack_destroyed)(struct nf_conn *conntrack) =NULL ;LIST_HEAD (nf_conntrack_expect_list); -struct nf_conntrack_protocol **nf_ct_protos[PF_MAX ]; -struct nf_conntrack_l3proto *nf_ct_l3protos[PF_MAX ]; +struct nf_conntrack_protocol **nf_ct_protos[PF_MAX ]__read_mostly ; +struct nf_conntrack_l3proto *nf_ct_l3protos[PF_MAX ]__read_mostly ;static LIST_HEAD (helpers);unsigned int nf_conntrack_htable_size =0 ;int nf_conntrack_max; -struct list_head *nf_conntrack_hash; -static kmem_cache_t *nf_conntrack_expect_cachep; +struct list_head *nf_conntrack_hash__read_mostly ; +static kmem_cache_t *nf_conntrack_expect_cachep__read_mostly ;struct nf_conn nf_conntrack_untracked;unsigned int nf_ct_log_invalid;static LIST_HEAD (unconfirmed); -static int nf_conntrack_vmalloc; +static int nf_conntrack_vmalloc__read_mostly ;static unsigned int nf_conntrack_next_id;static unsigned int nf_conntrack_expect_next_id;
Quoted 3 lines · Brian Haley
Make some netfilter globals
__read_mostlyat the request of Patrick McHardy.Signed-off-by Brian Haley <[email protected]>
These look good to me.
Signature · 2 lines
James Morris <[email protected]>
Patrick McHardy
AppliedQuoted 4 lines · Brian Haley
Make some netfilter globals
__read_mostlyat the request of Patrick McHardy.Signed-off-by Brian Haley <[email protected]>
Applied, thanks Brian.