lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/5] close various race windows for swap
On 21/04/08 09:08AM, Miaohe Lin wrote:
> Hi all,
> When I was investigating the swap code, I found some possible race
> windows. This series aims to fix all these races. But using current
> get/put_swap_device() to guard against concurrent swapoff for
> swap_readpage() looks terrible because swap_readpage() may take really
> long time. And to reduce the performance overhead on the hot-path as
> much as possible, it appears we can use the percpu_ref to close this
> race window(as suggested by Huang, Ying). The patch 1 adds percpu_ref
> support for swap and the rest of the patches use this to close various
> race windows. More details can be found in the respective changelogs.
> Thanks!
>
> Miaohe Lin (5):
> mm/swapfile: add percpu_ref support for swap
> swap: fix do_swap_page() race with swapoff
> mm/swap_state: fix get_shadow_from_swap_cache() race with swapoff
> mm/swap_state: fix potential faulted in race in swap_ra_info()
> mm/swap_state: fix swap_cluster_readahead() race with swapoff

Somehow I see Patch-1 and Patch-2 are missing on linux-mm[1].
Also I wanted to ask if you have a way to trigger this in a more controlled
environment (consistently)?

[1]: https://patchwork.kernel.org/project/linux-mm/cover/20210408130820.48233-1-linmiaohe@huawei.com/

-ritesh

>
> include/linux/swap.h | 4 +++-
> mm/memory.c | 10 +++++++++
> mm/swap_state.c | 33 +++++++++++++++++++++--------
> mm/swapfile.c | 50 +++++++++++++++++++++++++++-----------------
> 4 files changed, 68 insertions(+), 29 deletions(-)
>
> --
> 2.19.1
>
>

\
 
 \ /
  Last update: 2021-04-08 16:57    [W:0.221 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site