[PATCH 0/1] mm: fix race between MADV_FREE reclaim and blkdev direct IO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 6c8e2a256915a223f6289f651d6b926cd7135c9e upstream.

Backports for stable:

- folio/page differences on 5.17, 5.16, 5.15, 5.10, 5.4, 4.19;
- context lines differences on 4.14;
- conditional/gate differences on 4.9;
(changes described in each commit.)

Test-case with good results on all versions
(consistent values read on good/bad binary).

Links:
- FAILED: patch "[PATCH] mm: fix race between MADV_FREE reclaim and blkdev direct IO"
  failed to apply to <version>-stable tree
  - 5.17 https://lore.kernel.org/stable/1648897548136182@xxxxxxxxx/
  - 5.16 https://lore.kernel.org/stable/164889755413570@xxxxxxxxx/
  - 5.15 https://lore.kernel.org/stable/1648897560105145@xxxxxxxxx/
  - 5.10 https://lore.kernel.org/stable/1648897566131152@xxxxxxxxx/
  - 5.4  https://lore.kernel.org/stable/1648897573389@xxxxxxxxx/
  - 4.19 https://lore.kernel.org/stable/1648897585112208@xxxxxxxxx/
  - 4.14 https://lore.kernel.org/stable/1648897579250122@xxxxxxxxx/

The 4.9 version is also affected; there was an issue w/ the Fixes:
commit id from v4 not picked up in mainline -- it should cover 4.9
(also described in each commits).

cheers,
-- 
Mauricio


linux-5.17.y:
===

Original:

	+ uname -rv
	5.17.1-dirty #4 SMP PREEMPT Thu Apr 7 16:58:35 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fe09a90a000: 0x79
	0x7fe09a90b000: 0x79
	0x7fe09a90c000: 0x79
	0x7fe09a90d000: 0x79
	+ mv good bad
	+ ./bad
	0x7f6fd0a41000: 0x0
	0x7f6fd0a42000: 0x0
	0x7f6fd0a43000: 0x0
	0x7f6fd0a44000: 0x0

Patched:

	+ uname -rv
	5.17.1-00001-g68e35ffe374c-dirty #3 SMP PREEMPT Thu Apr 7 15:10:56 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fa65e4f5000: 0x79
	0x7fa65e4f6000: 0x79
	0x7fa65e4f7000: 0x79
	0x7fa65e4f8000: 0x79
	+ mv good bad
	+ ./bad
	0x7fa6b92d7000: 0x79
	0x7fa6b92d8000: 0x79
	0x7fa6b92d9000: 0x79
	0x7fa6b92da000: 0x79


linux-5.16.y:
===

Original:

	+ uname -rv
	5.16.18+ #1 SMP PREEMPT Thu Apr 7 15:17:17 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fc0a4634000: 0x79
	0x7fc0a4635000: 0x79
	0x7fc0a4636000: 0x79
	0x7fc0a4637000: 0x79
	+ mv good bad
	+ ./bad
	0x7fe5bbd8b000: 0x0
	0x7fe5bbd8c000: 0x0
	0x7fe5bbd8d000: 0x0
	0x7fe5bbd8e000: 0x79

Patched:

	+ uname -rv
	5.16.18+ #2 SMP PREEMPT Thu Apr 7 15:22:21 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f98cbe1d000: 0x79
	0x7f98cbe1e000: 0x79
	0x7f98cbe1f000: 0x79
	0x7f98cbe20000: 0x79
	+ mv good bad
	+ ./bad
	0x7f0194098000: 0x79
	0x7f0194099000: 0x79
	0x7f019409a000: 0x79
	0x7f019409b000: 0x79


linux-5.15.y:
===

Original:

	+ uname -rv
	5.15.32+ #2 SMP Thu Apr 7 15:38:32 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f45b2dcd000: 0x79
	0x7f45b2dce000: 0x79
	0x7f45b2dcf000: 0x79
	0x7f45b2dd0000: 0x79
	+ mv good bad
	+ ./bad
	0x7f477d3a2000: 0x0
	0x7f477d3a3000: 0x0
	0x7f477d3a4000: 0x0
	0x7f477d3a5000: 0x0

Patched:

	+ uname -rv
	5.15.32+ #3 SMP Thu Apr 7 15:40:33 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f918fc47000: 0x79
	0x7f918fc48000: 0x79
	0x7f918fc49000: 0x79
	0x7f918fc4a000: 0x79
	+ mv good bad
	+ ./bad
	0x7fd6153f5000: 0x79
	0x7fd6153f6000: 0x79
	0x7fd6153f7000: 0x79
	0x7fd6153f8000: 0x79


linux-5.10.y:
===

Original:

	+ uname -rv
	5.10.109+ #2 SMP Thu Apr 7 15:44:15 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f94a3750000: 0x79
	0x7f94a3751000: 0x79
	0x7f94a3752000: 0x79
	0x7f94a3753000: 0x79
	+ mv good bad
	+ ./bad
	0x7ff2e7938000: 0x0
	0x7ff2e7939000: 0x0
	0x7ff2e793a000: 0x0
	0x7ff2e793b000: 0x0

Patched:

	+ uname -rv
	5.10.109+ #3 SMP Thu Apr 7 15:45:41 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f2948d1d000: 0x79
	0x7f2948d1e000: 0x79
	0x7f2948d1f000: 0x79
	0x7f2948d20000: 0x79
	+ mv good bad
	+ ./bad
	0x7fe22a9c6000: 0x79
	0x7fe22a9c7000: 0x79
	0x7fe22a9c8000: 0x79
	0x7fe22a9c9000: 0x79


linux-5.4.y:
===

Original:

	+ uname -rv
	5.4.188+ #1 SMP Thu Apr 7 15:47:54 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fc53e9a2000: 0x79
	0x7fc53e9a3000: 0x79
	0x7fc53e9a4000: 0x79
	0x7fc53e9a5000: 0x79
	+ mv good bad
	+ ./bad
	0x7f88ce4fa000: 0x0
	0x7f88ce4fb000: 0x0
	0x7f88ce4fc000: 0x0
	0x7f88ce4fd000: 0x0

Patched:

	+ uname -rv
	5.4.188+ #2 SMP Thu Apr 7 15:49:19 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fd64b54c000: 0x79
	0x7fd64b54d000: 0x79
	0x7fd64b54e000: 0x79
	0x7fd64b54f000: 0x79
	+ mv good bad
	+ ./bad
	0x7f15ba253000: 0x79
	0x7f15ba254000: 0x79
	0x7f15ba255000: 0x79
	0x7f15ba256000: 0x79


linux-4.19.y:
===

Original:

	+ uname -rv
	4.19.237+ #1 SMP Thu Apr 7 15:51:11 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fe8d78b0000: 0x79
	0x7fe8d78b1000: 0x79
	0x7fe8d78b2000: 0x79
	0x7fe8d78b3000: 0x79
	+ mv good bad
	+ ./bad
	0x7f1d1f6e9000: 0x0
	0x7f1d1f6ea000: 0x0
	0x7f1d1f6eb000: 0x0
	0x7f1d1f6ec000: 0x0

Patched:

	+ uname -rv
	4.19.237+ #2 SMP Thu Apr 7 15:52:24 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f2bdb6c9000: 0x79
	0x7f2bdb6ca000: 0x79
	0x7f2bdb6cb000: 0x79
	0x7f2bdb6cc000: 0x79
	+ mv good bad
	+ ./bad
	0x7f0e7af0f000: 0x79
	0x7f0e7af10000: 0x79
	0x7f0e7af11000: 0x79
	0x7f0e7af12000: 0x79


linux-4.14.y:
===

Original:

	+ uname -rv
	4.14.275+ #2 SMP Thu Apr 7 15:55:08 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fb22c1e2000: 0x79
	0x7fb22c1e3000: 0x79
	0x7fb22c1e4000: 0x79
	0x7fb22c1e5000: 0x79
	+ mv good bad
	+ ./bad
	0x7fec8aad6000: 0x0
	0x7fec8aad7000: 0x0
	0x7fec8aad8000: 0x0
	0x7fec8aad9000: 0x0

Patched:

	+ uname -rv
	4.14.275+ #3 SMP Thu Apr 7 16:23:22 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fdfabd3f000: 0x79
	0x7fdfabd40000: 0x79
	0x7fdfabd41000: 0x79
	0x7fdfabd42000: 0x79
	+ mv good bad
	+ ./bad
	0x7f25da5c1000: 0x79
	0x7f25da5c2000: 0x79
	0x7f25da5c3000: 0x79
	0x7f25da5c4000: 0x79


linux-4.9.y:
===

	# dd if=/dev/zero of=swap.img bs=1M count=1024
	# mkswap swap.img
	# swapon swap.img

Original:

	+ uname -rv
	4.9.309+ #2 SMP Thu Apr 7 16:30:41 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7fb2ec63d000: 0x79
	0x7fb2ec63e000: 0x79
	0x7fb2ec63f000: 0x79
	0x7fb2ec640000: 0x79
	+ mv good bad
	+ ./bad
	0x7fdfaecf3000: 0x0
	0x7fdfaecf4000: 0x0
	0x7fdfaecf5000: 0x0
	0x7fdfaecf6000: 0x0

Patched:

	+ uname -rv
	4.9.309+ #3 SMP Thu Apr 7 16:48:00 UTC 2022
	...
	+ mv test good
	+ ./good
	0x7f8eeb60c000: 0x79
	0x7f8eeb60d000: 0x79
	0x7f8eeb60e000: 0x79
	0x7f8eeb60f000: 0x79
	+ mv good bad
	+ ./bad
	0x7f4696d1e000: 0x79
	0x7f4696d1f000: 0x79
	0x7f4696d20000: 0x79
	0x7f4696d21000: 0x79

-- 
2.32.0




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux