Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dst: call cond_resched() in dst_gc_task()

Kernel bugzilla #15239

On some workloads, it is quite possible to get a huge dst list to
process in dst_gc_task(), and trigger soft lockup detection.

Fix is to call cond_resched(), as we run in process context.

Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
2fc1b5dd d696c7bd

+2
+2
net/core/dst.c
··· 17 17 #include <linux/string.h> 18 18 #include <linux/types.h> 19 19 #include <net/net_namespace.h> 20 + #include <linux/sched.h> 20 21 21 22 #include <net/dst.h> 22 23 ··· 80 79 while ((dst = next) != NULL) { 81 80 next = dst->next; 82 81 prefetch(&next->next); 82 + cond_resched(); 83 83 if (likely(atomic_read(&dst->__refcnt))) { 84 84 last->next = dst; 85 85 last = dst;