]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
this_cpu: Use this_cpu ops for network statistics
authorChristoph Lameter <cl@linux-foundation.org>
Sat, 3 Oct 2009 10:48:22 +0000 (19:48 +0900)
committerTejun Heo <tj@kernel.org>
Sat, 3 Oct 2009 10:48:22 +0000 (19:48 +0900)
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: David Miller <davem@davemloft.net>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/net/neighbour.h
include/net/netfilter/nf_conntrack.h

index 3817fda82a80760cc977082311ec9dd805b651aa..f28403ff7648e286c85d131d1a848f01f1d35489 100644 (file)
@@ -90,12 +90,7 @@ struct neigh_statistics
        unsigned long unres_discards;   /* number of unresolved drops */
 };
 
-#define NEIGH_CACHE_STAT_INC(tbl, field)                               \
-       do {                                                            \
-               preempt_disable();                                      \
-               (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
-               preempt_enable();                                       \
-       } while (0)
+#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
 
 struct neighbour
 {
index cbdd6284996d3cd29732c0ae406833a678a3fb80..dde549779e422d113bd7e2025e9c391642326a87 100644 (file)
@@ -295,11 +295,11 @@ extern unsigned int nf_conntrack_htable_size;
 extern unsigned int nf_conntrack_max;
 
 #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)              \
 do {                                                   \
        local_bh_disable();                             \
-       per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++;   \
+       __this_cpu_inc((net)->ct.stat->count);          \
        local_bh_enable();                              \
 } while (0)