]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
percpu: add a schedule point in pcpu_balance_workfn()
authorEric Dumazet <edumazet@google.com>
Fri, 23 Feb 2018 16:12:42 +0000 (08:12 -0800)
committerTejun Heo <tj@kernel.org>
Fri, 23 Feb 2018 16:52:34 +0000 (08:52 -0800)
When a large BPF percpu map is destroyed, I have seen
pcpu_balance_workfn() holding cpu for hundreds of milliseconds.

On KASAN config and 112 hyperthreads, average time to destroy a chunk
is ~4 ms.

[ 2489.841376] destroy chunk 1 in 4148689 ns
...
[ 2490.093428] destroy chunk 32 in 4072718 ns

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/percpu.c

index fa3f854634a14cd85f944e2c09992e38775f593a..36e7b65ba6cf3f739a266b8cb4f93f5fbe6bc763 100644 (file)
@@ -1610,6 +1610,7 @@ static void pcpu_balance_workfn(struct work_struct *work)
                        spin_unlock_irq(&pcpu_lock);
                }
                pcpu_destroy_chunk(chunk);
+               cond_resched();
        }
 
        /*