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

Commit 4ea7334b authored by Christoph Lameter's avatar Christoph Lameter Committed by Tejun Heo
Browse files

this_cpu: Use this_cpu ops for network statistics

parent fce22848
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -90,12 +90,7 @@ struct neigh_statistics
	unsigned long unres_discards;	/* number of unresolved drops */
	unsigned long unres_discards;	/* number of unresolved drops */
};
};


#define NEIGH_CACHE_STAT_INC(tbl, field)				\
#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
	do {								\
		preempt_disable();					\
		(per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
		preempt_enable();					\
	} while (0)


struct neighbour
struct neighbour
{
{
+2 −2
Original line number Original line Diff line number Diff line
@@ -295,11 +295,11 @@ extern unsigned int nf_conntrack_htable_size;
extern unsigned int nf_conntrack_max;
extern unsigned int nf_conntrack_max;


#define NF_CT_STAT_INC(net, count)	\
#define NF_CT_STAT_INC(net, count)	\
	(per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++)
	__this_cpu_inc((net)->ct.stat->count)
#define NF_CT_STAT_INC_ATOMIC(net, count)		\
#define NF_CT_STAT_INC_ATOMIC(net, count)		\
do {							\
do {							\
	local_bh_disable();				\
	local_bh_disable();				\
	per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++;	\
	__this_cpu_inc((net)->ct.stat->count);		\
	local_bh_enable();				\
	local_bh_enable();				\
} while (0)
} while (0)