Re: [PATCH v2] mm: fix a race on nr_swap_pages

2020-12-04 Thread Vlastimil Babka
On 12/4/20 3:52 AM, Zhaoyang Huang wrote: > 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

[PATCH v2] mm: fix a race on nr_swap_pages

2020-12-03 Thread Zhaoyang Huang
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