diff options
-rw-r--r-- | net/core/sock.c | 5 | ||||
-rw-r--r-- | net/sched/sch_generic.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 363bc260157..b05b9b6ddb8 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2232,8 +2232,7 @@ static DECLARE_BITMAP(proto_inuse_idx, PROTO_INUSE_NR); | |||
2232 | #ifdef CONFIG_NET_NS | 2232 | #ifdef CONFIG_NET_NS |
2233 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) | 2233 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) |
2234 | { | 2234 | { |
2235 | int cpu = smp_processor_id(); | 2235 | __this_cpu_add(net->core.inuse->val[prot->inuse_idx], val); |
2236 | per_cpu_ptr(net->core.inuse, cpu)->val[prot->inuse_idx] += val; | ||
2237 | } | 2236 | } |
2238 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); | 2237 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); |
2239 | 2238 | ||
@@ -2279,7 +2278,7 @@ static DEFINE_PER_CPU(struct prot_inuse, prot_inuse); | |||
2279 | 2278 | ||
2280 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) | 2279 | void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) |
2281 | { | 2280 | { |
2282 | __get_cpu_var(prot_inuse).val[prot->inuse_idx] += val; | 2281 | __this_cpu_add(prot_inuse.val[prot->inuse_idx], val); |
2283 | } | 2282 | } |
2284 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); | 2283 | EXPORT_SYMBOL_GPL(sock_prot_inuse_add); |
2285 | 2284 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index d20fcd2a551..2aeb3a4386a 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -96,7 +96,7 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb, | |||
96 | * Another cpu is holding lock, requeue & delay xmits for | 96 | * Another cpu is holding lock, requeue & delay xmits for |
97 | * some time. | 97 | * some time. |
98 | */ | 98 | */ |
99 | __get_cpu_var(softnet_data).cpu_collision++; | 99 | __this_cpu_inc(softnet_data.cpu_collision); |
100 | ret = dev_requeue_skb(skb, q); | 100 | ret = dev_requeue_skb(skb, q); |
101 | } | 101 | } |
102 | 102 | ||