Thread (6 messages) flat view 6 messages, 4 authors, 2016-08-25

Re: [PATCH net-next] net: minor optimization in qdisc_qstats_cpu_drop()

From: Rick Jones <hidden>
Date: 2016-08-24 18:05:46

On 08/24/2016 10:23 AM, Eric Dumazet wrote:
From: Eric Dumazet <edumazet@google.com>

per_cpu_inc() is faster (at least on x86) than per_cpu_ptr(xxx)++;
Is it possible it is non-trivially slower on other architectures?

rick jones
quoted hunk ↗ jump to hunk
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/sch_generic.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 0d501779cc68f9426e58da6d039dd64adc937c20..52a2015667b49c8315edbb26513a98d4c677fee5 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -592,7 +592,7 @@ static inline void qdisc_qstats_drop(struct Qdisc *sch)

 static inline void qdisc_qstats_cpu_drop(struct Qdisc *sch)
 {
-	qstats_drop_inc(this_cpu_ptr(sch->cpu_qstats));
+	this_cpu_inc(sch->cpu_qstats->drops);
 }

 static inline void qdisc_qstats_overlimit(struct Qdisc *sch)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help