Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e5d27c7 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: don't do swap readahead during speculative page fault"

parents 8065b1ec 20c15495
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3097,6 +3097,17 @@ int do_swap_page(struct vm_fault *vmf)
				lru_cache_add_anon(page);
				swap_readpage(page, true);
			}
		} else if (vmf->flags & FAULT_FLAG_SPECULATIVE) {
			/*
			 * Don't try readahead during a speculative page fault
			 * as the VMA's boundaries may change in our back.
			 * If the page is not in the swap cache and synchronous
			 * read is disabled, fall back to the regular page fault
			 * mechanism.
			 */
			delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
			ret = VM_FAULT_RETRY;
			goto out;
		} else {
			page = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
						vmf);