Commit 1a8bc418 authored by Vern Hao's avatar Vern Hao Committed by Wen Zhiwei
Browse files

mm/vmscan: use folio_migratetype() instead of get_pageblock_migratetype()

stable inclusion
from stable-v6.6.51
commit 9a9974713de85e82ce6e51714925dddf2c9028a5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAYRVR

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9a9974713de85e82ce6e51714925dddf2c9028a5

--------------------------------

[ Upstream commit 97144ce008f918249fa7275ee1d29f6f27665c34 ]

In skip_cma(), we can use folio_migratetype() to replace
get_pageblock_migratetype().

Link: https://lkml.kernel.org/r/20230825075735.52436-1-user@VERNHAO-MC1


Signed-off-by: default avatarVern Hao <vernhao@tencent.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Stable-dep-of: bfe0857c20c6 ("Revert "mm: skip CMA pages when they are not available"")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent c1362d86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2294,7 +2294,7 @@ static bool skip_cma(struct folio *folio, struct scan_control *sc)
{
	return !current_is_kswapd() &&
			gfp_migratetype(sc->gfp_mask) != MIGRATE_MOVABLE &&
			get_pageblock_migratetype(&folio->page) == MIGRATE_CMA;
			folio_migratetype(folio) == MIGRATE_CMA;
}
#else
static bool skip_cma(struct folio *folio, struct scan_control *sc)