瀏覽代碼

percpu: add a schedule point in pcpu_balance_workfn()

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>
Eric Dumazet 7 年之前
父節點
當前提交
accd4f36a7
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      mm/percpu.c

+ 1 - 0
mm/percpu.c

@@ -1610,6 +1610,7 @@ static void pcpu_balance_workfn(struct work_struct *work)
 			spin_unlock_irq(&pcpu_lock);
 		}
 		pcpu_destroy_chunk(chunk);
+		cond_resched();
 	}
 
 	/*