Skip to content

Commit

Permalink
percpu: add a schedule point in pcpu_balance_workfn()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
Eric Dumazet authored and htejun committed Feb 23, 2018
1 parent 554fef1 commit accd4f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,7 @@ static void pcpu_balance_workfn(struct work_struct *work)
spin_unlock_irq(&pcpu_lock);
}
pcpu_destroy_chunk(chunk);
cond_resched();
}

/*
Expand Down

0 comments on commit accd4f3

Please sign in to comment.