Skip to contentSkip to conversation

net: sched: fix missing free per cpu on qstats

PATCH In review John Fastabend 5 participants 7 messages Jan 5, 2016 – Jan 6, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: sched: fix missing free per cpu on qstats

When a qdisc is using per cpu stats (currently just the ingress qdisc) only the bstats are being freed. This also free's the qstats.

---
 net/sched/sch_generic.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/sched/sch_generic.c +3 -1
index e82a1ad..16bc83b 100644
@@ -658,8 +658,10 @@ static void qdisc_rcu_free(struct rcu_head *head)
 {
 	struct Qdisc *qdisc = container_of(head, struct Qdisc, rcu_head);
 
-	if (qdisc_is_percpu_stats(qdisc))
+	if (qdisc_is_percpu_stats(qdisc)) {
 		free_percpu(qdisc->cpu_bstats);
+		free_percpu(qdisc->cpu_qstats);
+	}
 
 	kfree((char *) qdisc - qdisc->padded);
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · John Fastabend

When a qdisc is using per cpu stats (currently just the ingress qdisc) only the bstats are being freed. This also free's the qstats.

---

David, please add the following tag to ease backports to stable kernels:

Fixes 22e0f8b9322cb ("net: sched: make bstats per cpu and estimator RCU safe")

Thanks !

maintainer
#2 lore raw

From: Eric Dumazet <[email protected]>
Date: Tue, 05 Jan 2016 09:44:11 -0800

Quoted 3 lines

David, please add the following tag to ease backports to stable kernels:

Fixes 22e0f8b9322cb ("net: sched: make bstats per cpu and estimator RCU safe")

Ok, will do, thanks!

#3 lore raw
In reply to Eric Dumazet
Quoted 4 lines · Eric Dumazet
Quoted 3 lines · John Fastabend

When a qdisc is using per cpu stats (currently just the ingress qdisc) only the bstats are being freed. This also free's the qstats.

Quoted 9 lines
Quoted 2 lines

---

David, please add the following tag to ease backports to stable kernels:

Fixes 22e0f8b9322cb ("net: sched: make bstats per cpu and estimator RCU safe")

Not a big deal at all but... doesn't that fix commit b0ab6f92752b9f9d8 instead of 22e0f8b9322cb?

#4 lore raw
Quoted 10 lines · Cong Wang
Quoted 9 lines · Eric Dumazet
Quoted 5 lines · John Fastabend

When a qdisc is using per cpu stats (currently just the ingress qdisc) only the bstats are being freed. This also free's the qstats.

---

Quoted 7 lines
Quoted 4 lines

David, please add the following tag to ease backports to stable kernels:

Fixes 22e0f8b9322cb ("net: sched: make bstats per cpu and estimator RCU safe")

Not a big deal at all but... doesn't that fix commit b0ab6f92752b9f9d8 instead of 22e0f8b9322cb?

Hmmm... you may be right. Both were added in 3.18.

My search was based on commit adding qdisc_is_percpu_stats()

maintainer
#5 lore raw

From: Eric Dumazet <[email protected]>
Date: Tue, 05 Jan 2016 19:07:49 -0800

Quoted 16 lines · Cong Wang
Quoted 15 lines · Eric Dumazet
Quoted 13 lines · John Fastabend
Quoted 5 lines

When a qdisc is using per cpu stats (currently just the ingress qdisc) only the bstats are being freed. This also free's the qstats.

---

David, please add the following tag to ease backports to stable kernels:

Fixes 22e0f8b9322cb ("net: sched: make bstats per cpu and estimator RCU safe")
Quoted 6 lines
Quoted 2 lines

Not a big deal at all but... doesn't that fix commit b0ab6f92752b9f9d8 instead of 22e0f8b9322cb?

Hmmm... you may be right. Both were added in 3.18.

My search was based on commit adding qdisc_is_percpu_stats()

The right commit looks to be b0ab6f92752b9f9d8, so that's what I've used in the Fixes: tag.

Applied and queued up for -stable, thanks!