Commit daaca627 authored by Roman Gushchin's avatar Roman Gushchin Committed by Zheng Zengkai
Browse files

percpu: split __pcpu_balance_workfn()

mainline inclusion
from mainline-v5.14-rc1
commit 67c2669d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4BE79


CVE: NA

-------------------------------------------------
__pcpu_balance_workfn() became fairly big and hard to follow, but in
fact it consists of two fully independent parts, responsible for
the destruction of excessive free chunks and population of necessarily
amount of free pages.

In order to simplify the code and prepare for adding of a new
functionality, split it in two functions:

  1) pcpu_balance_free,
  2) pcpu_balance_populated.

Move the taking/releasing of the pcpu_alloc_mutex to an upper level
to keep the current synchronization in place.

Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
Reviewed-by: default avatarDennis Zhou <dennis@kernel.org>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
(cherry picked from commit 67c2669d)
Signed-off-by: default avatarYuanzheng Song <songyuanzheng@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 88c08fa6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment