commit | 5b6807de11445c05b537df8324f5d7ab1c2782f9 | [log] [tgz] |
---|---|---|
author | Vitaly Wool <[email protected]> | Sun Oct 06 17:58:22 2019 -0700 |
committer | Linus Torvalds <[email protected]> | Mon Oct 07 15:47:19 2019 -0700 |
tree | 3c0965d85ecaf69ee21532a11925976f4409254c | |
parent | b0f53dbc4bc4c371f38b14c391095a3bb8a0bb40 [diff] |
mm/z3fold.c: claim page in the beginning of free There's a really hard to reproduce race in z3fold between z3fold_free() and z3fold_reclaim_page(). z3fold_reclaim_page() can claim the page after z3fold_free() has checked if the page was claimed and z3fold_free() will then schedule this page for compaction which may in turn lead to random page faults (since that page would have been reclaimed by then). Fix that by claiming page in the beginning of z3fold_free() and not forgetting to clear the claim in the end. [[email protected]: v2] Link: http://lkml.kernel.org/r/20190928113456.152742cf@bigdell Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Vitaly Wool <[email protected]> Reported-by: Markus Linnala <[email protected]> Cc: Dan Streetman <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Henry Burns <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Markus Linnala <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>