 codel: remove sch-&gt;q.qlen check before qdisc_tree_reduce_backlog() · gregkh/linux@342debc · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection  EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events &amp; webinars Ebooks &amp; reports Business insights GitHub Skills SUPPORT &amp; SERVICES Documentation Customer support Community forum Trust center Partners View all resources Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator GitHub Stars Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously.  Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gregkh / linux Public Notifications You must be signed in to change notification settings Fork 686 Star 644 Code Actions Security and quality 0 Insights Additional navigation options Code Actions Security and quality Insights Commit 342debc Browse files Browse files congwang authored and Paolo Abeni committed codel: remove sch-&gt;q.qlen check before qdisc_tree_reduce_backlog() After making all -&gt;qlen_notify() callbacks idempotent, now it is safe to remove the check of qlen!=0 from both fq_codel_dequeue() and codel_qdisc_dequeue(). Reported-by: Gerrard Tai &lt;gerrard.tai@starlabs.sg&gt; Fixes: 4b549a2 ("fq_codel: Fair Queue Codel AQM") Fixes: 76e3cc1 ("codel: Controlled Delay AQM") Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt; Reviewed-by: Simon Horman &lt;horms@kernel.org&gt; Link: https://patch.msgid.link/20250403211636.166257-1-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt; Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt; 1 parent a7a15f3 commit 342debc Copy full SHA for 342debc 2 file s changed + 3 - 8 Lines changed: 3 additions &amp; 8 deletions File tree Expand file tree Collapse file tree Open diff view settings Filter options net/sched sch_codel.c sch_fq_codel.c Expand file tree Collapse file tree Open diff view settings Collapse file ‎ net/sched/sch_codel.c ‎ Copy file name to clipboard Expand all lines: net/sched/sch_codel.c + 1 - 4 Lines changed: 1 addition &amp; 4 deletions Original file line number Diff line number Diff line change @@ -65,10 +65,7 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch) 65 65 &amp; q -&gt; stats , qdisc_pkt_len , codel_get_enqueue_time , 66 66 drop_func , dequeue_func ); 67 67 68 - /* We cant call qdisc_tree_reduce_backlog() if our qlen is 0, 69 - * or HTB crashes. Defer it for next round. 70 - */ 71 - if ( q -&gt; stats . drop_count &amp;&amp; sch -&gt; q . qlen ) { 68 + if ( q -&gt; stats . drop_count ) { 72 69 qdisc_tree_reduce_backlog ( sch , q -&gt; stats . drop_count , q -&gt; stats . drop_len ); 73 70 q -&gt; stats . drop_count = 0 ; 74 71 q -&gt; stats . drop_len = 0 ; Collapse file ‎ net/sched/sch_fq_codel.c ‎ Copy file name to clipboard Expand all lines: net/sched/sch_fq_codel.c + 2 - 4 Lines changed: 2 additions &amp; 4 deletions Original file line number Diff line number Diff line change @@ -315,10 +315,8 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch) 315 315 } 316 316 qdisc_bstats_update ( sch , skb ); 317 317 flow -&gt; deficit -= qdisc_pkt_len ( skb ); 318 - /* We cant call qdisc_tree_reduce_backlog() if our qlen is 0, 319 - * or HTB crashes. Defer it for next round. 320 - */ 321 - if ( q -&gt; cstats . drop_count &amp;&amp; sch -&gt; q . qlen ) { 318 + 319 + if ( q -&gt; cstats . drop_count ) { 322 320 qdisc_tree_reduce_backlog ( sch , q -&gt; cstats . drop_count , 323 321 q -&gt; cstats . drop_len ); 324 322 q -&gt; cstats . drop_count = 0 ; 0 commit comments Comments 0 ( 0 ) Footer &copy; 2026 GitHub,&nbsp;Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. 