Skip to content

Commit aa29a95

Browse files
JasonXingjfvogel
authored andcommitted
page_pool: avoid infinite loop to schedule delayed worker
[ Upstream commit 43130d02baa137033c25297aaae95fd0edc41654 ] We noticed the kworker in page_pool_release_retry() was waken up repeatedly and infinitely in production because of the buggy driver causing the inflight less than 0 and warning us in page_pool_inflight()[1]. Since the inflight value goes negative, it means we should not expect the whole page_pool to get back to work normally. This patch mitigates the adverse effect by not rescheduling the kworker when detecting the inflight negative in page_pool_release_retry(). [1] [Mon Feb 10 20:36:11 2025] ------------[ cut here ]------------ [Mon Feb 10 20:36:11 2025] Negative(-51446) inflight packet-pages ... [Mon Feb 10 20:36:11 2025] Call Trace: [Mon Feb 10 20:36:11 2025] page_pool_release_retry+0x23/0x70 [Mon Feb 10 20:36:11 2025] process_one_work+0x1b1/0x370 [Mon Feb 10 20:36:11 2025] worker_thread+0x37/0x3a0 [Mon Feb 10 20:36:11 2025] kthread+0x11a/0x140 [Mon Feb 10 20:36:11 2025] ? process_one_work+0x370/0x370 [Mon Feb 10 20:36:11 2025] ? __kthread_cancel_work+0x40/0x40 [Mon Feb 10 20:36:11 2025] ret_from_fork+0x35/0x40 [Mon Feb 10 20:36:11 2025] ---[ end trace ebffe800f33e7e34 ]--- Note: before this patch, the above calltrace would flood the dmesg due to repeated reschedule of release_dw kworker. Signed-off-by: Jason Xing <[email protected]> Reviewed-by: Mina Almasry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 7204335d1991c23fc615ab76f31f175748a578e1) Signed-off-by: Jack Vogel <[email protected]>
1 parent b6f84cc commit aa29a95

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

net/core/page_pool.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,13 @@ static void page_pool_release_retry(struct work_struct *wq)
10661066
int inflight;
10671067

10681068
inflight = page_pool_release(pool);
1069-
if (!inflight)
1069+
/* In rare cases, a driver bug may cause inflight to go negative.
1070+
* Don't reschedule release if inflight is 0 or negative.
1071+
* - If 0, the page_pool has been destroyed
1072+
* - if negative, we will never recover
1073+
* in both cases no reschedule is necessary.
1074+
*/
1075+
if (inflight <= 0)
10701076
return;
10711077

10721078
/* Periodic warning for page pools the user can't see */

0 commit comments

Comments
 (0)