alinux: kernel: Reduce tasklist_lock contention at fork and exit
to #16966300 to #16966377 We observed heavy tasklist_lock contention when offline tasks start and end, which caused long scheduling latency and long period with interrupt off since write_lock_irq() is called. In extreme cases with tons of concurrent fork and exit events, it can cause the system hung. This patch changed them to use trylock, then operations within lock consume little time, so it naturally addresses the issue. After this patch, when I launched and killed thousands of tasks, the latency can reduce from tens of milliscends to around 2ms on my box. The patch can pass Unixbench tests, no regression introduced. Reviewed-by: NShanpei Chen <shanpeic@linux.alibaba.com> Signed-off-by: NXunlei Pang <xlpang@linux.alibaba.com> Acked-by: NShile Zhang <shile.zhang@linux.alibaba.com>
Showing
想要评论请 注册 或 登录