summaryrefslogtreecommitdiff
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorZhaoyang Huang <huangzhaoyang@gmail.com>2020-12-15 20:42:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-15 22:46:15 -0800
commitb50da6e9f42ade19141f6cf8870bb2312b055aa3 (patch)
treed504e2dec660733535ee66b19181cbde335b65c5 /mm/memory_hotplug.c
parent489e9fea66f31086f85d9a18e61e4791d94a56a4 (diff)
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 'mm/memory_hotplug.c')
0 files changed, 0 insertions, 0 deletions