]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Aug 2025 13:17:19 +0000 (15:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Aug 2025 13:17:19 +0000 (15:17 +0200)
added patches:
sch_hfsc-make-hfsc_qlen_notify-idempotent.patch
sch_htb-make-htb_qlen_notify-idempotent.patch
sch_qfq-make-qfq_qlen_notify-idempotent.patch

queue-5.15/sch_hfsc-make-hfsc_qlen_notify-idempotent.patch [new file with mode: 0644]
queue-5.15/sch_htb-make-htb_qlen_notify-idempotent.patch [new file with mode: 0644]
queue-5.15/sch_qfq-make-qfq_qlen_notify-idempotent.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/sch_hfsc-make-hfsc_qlen_notify-idempotent.patch b/queue-5.15/sch_hfsc-make-hfsc_qlen_notify-idempotent.patch
new file mode 100644 (file)
index 0000000..e9784e4
--- /dev/null
@@ -0,0 +1,54 @@
+From 51eb3b65544c9efd6a1026889ee5fb5aa62da3bb Mon Sep 17 00:00:00 2001
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Thu, 3 Apr 2025 14:10:25 -0700
+Subject: sch_hfsc: make hfsc_qlen_notify() idempotent
+
+From: Cong Wang <xiyou.wangcong@gmail.com>
+
+commit 51eb3b65544c9efd6a1026889ee5fb5aa62da3bb upstream.
+
+hfsc_qlen_notify() is not idempotent either and not friendly
+to its callers, like fq_codel_dequeue(). Let's make it idempotent
+to ease qdisc_tree_reduce_backlog() callers' life:
+
+1. update_vf() decreases cl->cl_nactive, so we can check whether it is
+non-zero before calling it.
+
+2. eltree_remove() always removes RB node cl->el_node, but we can use
+   RB_EMPTY_NODE() + RB_CLEAR_NODE() to make it safe.
+
+Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20250403211033.166059-4-xiyou.wangcong@gmail.com
+Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/sch_hfsc.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/net/sched/sch_hfsc.c
++++ b/net/sched/sch_hfsc.c
+@@ -209,7 +209,10 @@ eltree_insert(struct hfsc_class *cl)
+ static inline void
+ eltree_remove(struct hfsc_class *cl)
+ {
+-      rb_erase(&cl->el_node, &cl->sched->eligible);
++      if (!RB_EMPTY_NODE(&cl->el_node)) {
++              rb_erase(&cl->el_node, &cl->sched->eligible);
++              RB_CLEAR_NODE(&cl->el_node);
++      }
+ }
+ static inline void
+@@ -1231,7 +1234,8 @@ hfsc_qlen_notify(struct Qdisc *sch, unsi
+       /* vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
+        * needs to be called explicitly to remove a class from vttree.
+        */
+-      update_vf(cl, 0, 0);
++      if (cl->cl_nactive)
++              update_vf(cl, 0, 0);
+       if (cl->cl_flags & HFSC_RSC)
+               eltree_remove(cl);
+ }
diff --git a/queue-5.15/sch_htb-make-htb_qlen_notify-idempotent.patch b/queue-5.15/sch_htb-make-htb_qlen_notify-idempotent.patch
new file mode 100644 (file)
index 0000000..8092c5a
--- /dev/null
@@ -0,0 +1,38 @@
+From 5ba8b837b522d7051ef81bacf3d95383ff8edce5 Mon Sep 17 00:00:00 2001
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Thu, 3 Apr 2025 14:10:23 -0700
+Subject: sch_htb: make htb_qlen_notify() idempotent
+
+From: Cong Wang <xiyou.wangcong@gmail.com>
+
+commit 5ba8b837b522d7051ef81bacf3d95383ff8edce5 upstream.
+
+htb_qlen_notify() always deactivates the HTB class and in fact could
+trigger a warning if it is already deactivated. Therefore, it is not
+idempotent and not friendly to its callers, like fq_codel_dequeue().
+
+Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers'
+life.
+
+Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20250403211033.166059-2-xiyou.wangcong@gmail.com
+Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/sch_htb.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/net/sched/sch_htb.c
++++ b/net/sched/sch_htb.c
+@@ -1506,6 +1506,8 @@ static void htb_qlen_notify(struct Qdisc
+ {
+       struct htb_class *cl = (struct htb_class *)arg;
++      if (!cl->prio_activity)
++              return;
+       htb_deactivate(qdisc_priv(sch), cl);
+ }
diff --git a/queue-5.15/sch_qfq-make-qfq_qlen_notify-idempotent.patch b/queue-5.15/sch_qfq-make-qfq_qlen_notify-idempotent.patch
new file mode 100644 (file)
index 0000000..50fce9b
--- /dev/null
@@ -0,0 +1,66 @@
+From 55f9eca4bfe30a15d8656f915922e8c98b7f0728 Mon Sep 17 00:00:00 2001
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Thu, 3 Apr 2025 14:10:26 -0700
+Subject: sch_qfq: make qfq_qlen_notify() idempotent
+
+From: Cong Wang <xiyou.wangcong@gmail.com>
+
+commit 55f9eca4bfe30a15d8656f915922e8c98b7f0728 upstream.
+
+qfq_qlen_notify() always deletes its class from its active list
+with list_del_init() _and_ calls qfq_deactivate_agg() when the whole list
+becomes empty.
+
+To make it idempotent, just skip everything when it is not in the active
+list.
+
+Also change other list_del()'s to list_del_init() just to be extra safe.
+
+Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20250403211033.166059-5-xiyou.wangcong@gmail.com
+Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/sched/sch_qfq.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/net/sched/sch_qfq.c
++++ b/net/sched/sch_qfq.c
+@@ -354,7 +354,7 @@ static void qfq_deactivate_class(struct
+       struct qfq_aggregate *agg = cl->agg;
+-      list_del(&cl->alist); /* remove from RR queue of the aggregate */
++      list_del_init(&cl->alist); /* remove from RR queue of the aggregate */
+       if (list_empty(&agg->active)) /* agg is now inactive */
+               qfq_deactivate_agg(q, agg);
+ }
+@@ -486,6 +486,7 @@ static int qfq_change_class(struct Qdisc
+       cl->common.classid = classid;
+       cl->deficit = lmax;
++      INIT_LIST_HEAD(&cl->alist);
+       cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
+                                     classid, NULL);
+@@ -1006,7 +1007,7 @@ static struct sk_buff *agg_dequeue(struc
+       cl->deficit -= (int) len;
+       if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */
+-              list_del(&cl->alist);
++              list_del_init(&cl->alist);
+       else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) {
+               cl->deficit += agg->lmax;
+               list_move_tail(&cl->alist, &agg->active);
+@@ -1438,6 +1439,8 @@ static void qfq_qlen_notify(struct Qdisc
+       struct qfq_sched *q = qdisc_priv(sch);
+       struct qfq_class *cl = (struct qfq_class *)arg;
++      if (list_empty(&cl->alist))
++              return;
+       qfq_deactivate_class(q, cl);
+ }
index 81c4d02e322e832f2fd72a866216b251c07c685e..c4a683fac0e92d5a385a3ac5ef203c6799c22daf 100644 (file)
@@ -500,3 +500,6 @@ net-hsr-reject-hsr-frame-if-skb-can-t-hold-tag.patch
 ipv6-sr-fix-mac-comparison-to-be-constant-time.patch
 mptcp-drop-skb-if-mptcp-skb-extension-allocation-fails.patch
 mptcp-pm-kernel-flush-do-not-reset-add_addr-limit.patch
+sch_htb-make-htb_qlen_notify-idempotent.patch
+sch_hfsc-make-hfsc_qlen_notify-idempotent.patch
+sch_qfq-make-qfq_qlen_notify-idempotent.patch