Commit 2a6f512412c7aecd04134721ea392cc496e6c017
Committed by
Linus Torvalds
1 parent
ffb22af5b7
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
CMA: make putback_lru_pages() call conditional
As per documentation and other places calling putback_lru_pages(), putback_lru_pages() is called on error only. Make the CMA code behave consistently. [akpm@linux-foundation.org: remove a test-n-branch in the wrapup code] Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff
mm/page_alloc.c
... | ... | @@ -5806,9 +5806,11 @@ |
5806 | 5806 | 0, false, MIGRATE_SYNC, |
5807 | 5807 | MR_CMA); |
5808 | 5808 | } |
5809 | - | |
5810 | - putback_movable_pages(&cc->migratepages); | |
5811 | - return ret > 0 ? 0 : ret; | |
5809 | + if (ret < 0) { | |
5810 | + putback_movable_pages(&cc->migratepages); | |
5811 | + return ret; | |
5812 | + } | |
5813 | + return 0; | |
5812 | 5814 | } |
5813 | 5815 | |
5814 | 5816 | /** |