Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba89966c authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

[NET]: use __read_mostly on kmem_cache_t , DEFINE_SNMP_STAT pointers



This patch puts mostly read only data in the right section
(read_mostly), to help sharing of these data between CPUS without
memory ping pongs.

On one of my production machine, tcp_statistics was sitting in a
heavily modified cache line, so *every* SNMP update had to force a
reload.

Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29cb9f9c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <asm/atomic.h>
#include "br_private.h"

static kmem_cache_t *br_fdb_cache;
static kmem_cache_t *br_fdb_cache __read_mostly;
static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
		      const unsigned char *addr);

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static DEFINE_PER_CPU(struct flow_cache_entry **, flow_tables) = { NULL };

#define flow_table(cpu) (per_cpu(flow_tables, cpu))

static kmem_cache_t *flow_cachep;
static kmem_cache_t *flow_cachep __read_mostly;

static int flow_lwm, flow_hwm;

+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@
#include <asm/uaccess.h>
#include <asm/system.h>

static kmem_cache_t *skbuff_head_cache;
static kmem_cache_t *skbuff_fclone_cache;
static kmem_cache_t *skbuff_head_cache __read_mostly;
static kmem_cache_t *skbuff_fclone_cache __read_mostly;

struct timeval __read_mostly skb_tv_base;

+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static int ccid3_debug;
static struct dccp_tx_hist *ccid3_tx_hist;
static struct dccp_rx_hist *ccid3_rx_hist;

static kmem_cache_t *ccid3_loss_interval_hist_slab;
static kmem_cache_t *ccid3_loss_interval_hist_slab __read_mostly;

static inline struct ccid3_loss_interval_hist_entry *
	ccid3_loss_interval_hist_entry_new(const unsigned int __nocast prio)
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
#include "ccid.h"
#include "dccp.h"

DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics);
DEFINE_SNMP_STAT(struct dccp_mib, dccp_statistics) __read_mostly;

atomic_t dccp_orphan_count = ATOMIC_INIT(0);

Loading