diff options
author | 2020-12-15 20:42:23 -0800 | |
---|---|---|
committer | 2020-12-15 22:46:15 -0800 | |
commit | b50da6e9f42ade19141f6cf8870bb2312b055aa3 (patch) | |
tree | d504e2dec660733535ee66b19181cbde335b65c5 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | Merge tag 'pci-v5.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci (diff) | |
download | linux-dev-b50da6e9f42ade19141f6cf8870bb2312b055aa3.tar.xz linux-dev-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/1607050340-4535-1-git-send-email-zhaoyang.huang@unisoc.com
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions