Re: [PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-19 Thread Miaohe Lin
On 2021/4/19 10:23, Huang, Ying wrote: > Miaohe Lin writes: > >> When I was investigating the swap code, I found the below possible race >> window: >> >> CPU 1CPU 2 >> -- >> do_swap_page > > This is OK for

Re: [PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-18 Thread Huang, Ying
Miaohe Lin writes: > When I was investigating the swap code, I found the below possible race > window: > > CPU 1 CPU 2 > - - > do_swap_page This is OK for swap cache cases. So if (data_race(si->flags &

[PATCH v2 3/5] swap: fix do_swap_page() race with swapoff

2021-04-17 Thread Miaohe Lin
When I was investigating the swap code, I found the below possible race window: CPU 1 CPU 2 - - do_swap_page swap_readpage(skip swap cache case) if (data_race(sis->flags & SWP_FS_OPS)) {