Skip to content

Commit be00966

Browse files
kuba-mooPaolo Abeni
authored andcommitted
net: page_pool: mute the periodic warning for visible page pools
Mute the periodic "stalled pool shutdown" warning if the page pool is visible to user space. Rolling out a driver using page pools to just a few hundred hosts at Meta surfaces applications which fail to reap their broken sockets. Obviously it's best if the applications are fixed, but we don't generally print warnings for application resource leaks. Admins can now depend on the netlink interface for getting page pool info to detect buggy apps. While at it throw in the ID of the pool into the message, in rare cases (pools from destroyed netns) this will make finding the pool with a debugger easier. Reviewed-by: Eric Dumazet <edumazet@google.com> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent d49010a commit be00966

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net/core/page_pool.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,18 +897,21 @@ static void page_pool_release_retry(struct work_struct *wq)
897897
{
898898
struct delayed_work *dwq = to_delayed_work(wq);
899899
struct page_pool *pool = container_of(dwq, typeof(*pool), release_dw);
900+
void *netdev;
900901
int inflight;
901902

902903
inflight = page_pool_release(pool);
903904
if (!inflight)
904905
return;
905906

906-
/* Periodic warning */
907-
if (time_after_eq(jiffies, pool->defer_warn)) {
907+
/* Periodic warning for page pools the user can't see */
908+
netdev = READ_ONCE(pool->slow.netdev);
909+
if (time_after_eq(jiffies, pool->defer_warn) &&
910+
(!netdev || netdev == NET_PTR_POISON)) {
908911
int sec = (s32)((u32)jiffies - (u32)pool->defer_start) / HZ;
909912

910-
pr_warn("%s() stalled pool shutdown %d inflight %d sec\n",
911-
__func__, inflight, sec);
913+
pr_warn("%s() stalled pool shutdown: id %u, %d inflight %d sec\n",
914+
__func__, pool->user.id, inflight, sec);
912915
pool->defer_warn = jiffies + DEFER_WARN_INTERVAL;
913916
}
914917

0 commit comments

Comments
 (0)