linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Question] Is there a race window between swapoff vs synchronous swap_readpage
@ 2021-03-29 13:18 Miaohe Lin
  2021-03-30  1:57 ` Huang, Ying
  0 siblings, 1 reply; 9+ messages in thread
From: Miaohe Lin @ 2021-03-29 13:18 UTC (permalink / raw)
  To: Linux-MM, linux-kernel
  Cc: Andrew Morton, Matthew Wilcox, Yu Zhao, Shakeel Butt, Alex Shi,
	Huang Ying

Hi all,
I am investigating the swap code, and I found the below possible race window:

CPU 1							CPU 2
-----							-----
do_swap_page
  skip swapcache case (synchronous swap_readpage)
    alloc_page_vma
							swapoff
							  release swap_file, bdev, or ...
      swap_readpage
	check sis->flags is ok
	  access swap_file, bdev or ...[oops!]
							    si->flags = 0

The swapcache case is ok because swapoff will wait on the page_lock of swapcache page.
Is this will really happen or Am I miss something ?
Any reply would be really grateful. Thanks! :)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-12  3:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 13:18 [Question] Is there a race window between swapoff vs synchronous swap_readpage Miaohe Lin
2021-03-30  1:57 ` Huang, Ying
2021-03-30  3:15   ` Miaohe Lin
2021-03-30  3:44     ` Huang, Ying
2021-03-30  5:47       ` Yu Zhao
2021-03-30  6:57         ` Huang, Ying
2021-03-30  7:27           ` Yu Zhao
2021-04-12  3:12             ` Miaohe Lin
2021-03-30 11:21       ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).