diff mbox series

[RFC,14/24] mm/swap_state: disable swap vma readahead

Message ID 20200224203057.162467-15-walken@google.com (mailing list archive)
State New, archived
Headers show
Series Fine grained MM locking | expand

Commit Message

Michel Lespinasse Feb. 24, 2020, 8:30 p.m. UTC
This change disables swap vma readahead. This is because swap_ra_info()
updates vma->swap_readahead_info, which is not feasible when operating
on pseudo-vmas.

This is a crude temporary solution. It may be possible to use a per-mm
swap_readahead_info instead, or if not, to explicitly fetch the vma of
record when updating the swap readahead statistics.

Signed-off-by: Michel Lespinasse <walken@google.com>
---
 mm/swap_state.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git mm/swap_state.c mm/swap_state.c
index 8e7ce9a9bc5e..c9cdfd9c785e 100644
--- mm/swap_state.c
+++ mm/swap_state.c
@@ -298,6 +298,12 @@  void free_pages_and_swap_cache(struct page **pages, int nr)
 
 static inline bool swap_use_vma_readahead(void)
 {
+	/*
+	 * vma readahead overwrites vma->swap_readahead_info,
+	 * which requires some form of vma locking...
+	 */
+	return false;
+
 	return READ_ONCE(enable_vma_readahead) && !atomic_read(&nr_rotate_swap);
 }