Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() race with swapoff

2021-04-19 Thread Miaohe Lin
On 2021/4/19 15:41, Huang, Ying wrote: > Miaohe Lin writes: > >> On 2021/4/19 15:04, Huang, Ying wrote: >>> Miaohe Lin writes: >>> On 2021/4/19 10:15, Huang, Ying wrote: > Miaohe Lin writes: > >> When I was investigating the swap code, I found the below possible race >>

Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() race with swapoff

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

Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() race with swapoff

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

Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() race with swapoff

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

Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() race with swapoff

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

Re: [PATCH v2 5/5] mm/shmem: fix shmem_swapin() 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 > - - > shmem_swapin > swap_cluster_readahead > if (likely(si->flags &

[PATCH v2 5/5] mm/shmem: fix shmem_swapin() 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 - - shmem_swapin swap_cluster_readahead if (likely(si->flags & (SWP_BLKDEV | SWP_FS_OPS))) {