Re: [syzbot] [net?] INFO: rcu detected stall in fq_pie_timer (2)

From: Hillf Danton
Date: Fri Dec 29 2023 - 05:46:20 EST


On Wed, 27 Dec 2023 05:54:18 -0800
> HEAD commit: 7c5e046bdcb2 Merge tag 'net-6.7-rc7' of git://git.kernel.o..
> git tree: net
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1127e71ae80000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/net/sched/sch_fq_pie.c
+++ y/net/sched/sch_fq_pie.c
@@ -385,8 +385,7 @@ static void fq_pie_timer(struct timer_li
root_lock = qdisc_lock(qdisc_root_sleeping(sch));
spin_lock(root_lock);

- /* Limit this expensive loop to 2048 flows per round. */
- max_cnt = min_t(int, q->flows_cnt - q->flows_cursor, 2048);
+ max_cnt = min_t(int, q->flows_cnt - q->flows_cursor, 512);
for (i = 0; i < max_cnt; i++) {
pie_calculate_probability(&q->p_params,
&q->flows[q->flows_cursor].vars,
@@ -401,7 +400,7 @@ static void fq_pie_timer(struct timer_li
next = tupdate;
}
if (tupdate)
- mod_timer(&q->adapt_timer, jiffies + next);
+ mod_timer(&q->adapt_timer, jiffies + max(2, next));
spin_unlock(root_lock);
rcu_read_unlock();
}
--