diff options
| author | Zhaoyang Huang <[email protected]> | 2020-12-16 04:42:23 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2020-12-16 06:46:15 +0000 |
| commit | b50da6e9f42ade19141f6cf8870bb2312b055aa3 (patch) | |
| tree | d504e2dec660733535ee66b19181cbde335b65c5 /fs/proc/array.c | |
| parent | Merge tag 'pci-v5.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
| download | kernel-b50da6e9f42ade19141f6cf8870bb2312b055aa3.tar.gz kernel-b50da6e9f42ade19141f6cf8870bb2312b055aa3.zip | |
mm: fix a race on nr_swap_pages
The scenario on which "Free swap = -4kB" happens in my system, which is caused
by several get_swap_pages racing with each other and show_swap_cache_info
happens simutaniously. No need to add a lock on get_swap_page_of_type as we
remove "Presub/PosAdd" here.
ProcessA ProcessB ProcessC
ngoals = 1 ngoals = 1
avail = nr_swap_pages(1) avail = nr_swap_pages(1)
nr_swap_pages(1) -= ngoals
nr_swap_pages(0) -= ngoals
nr_swap_pages = -1
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Zhaoyang Huang <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions
