Description of problem: For page allocation: In the past, movable allocations could be disallowed from CMA through PF_MEMALLOC_PIN. However, since 5d0a661 ("mm/page_alloc: use only one PCP list for THP-sized allocations"), THP-sized pages of different types are put into one PCP list. When allocate a THP with PF_MEMALLOC_PIN, it would accidentally get a CMA page from PCP list, which will cause the program to not run correctly. So, PCP list can't be used for THP-sized allocations when using PF_MEMALLOC_PIN. For page migration: Before migrating a page, we need to drain the page out of cpu's pagevecs if the page is in cpu's pagevecs. Otherwise, the migration will fail because of incorrect page reference. Whatever the return value of the function folio_test_lru() is, it does not tell whether the page is in cpu's pagevecs. Therefore, the check folio_test_lru() needs to be removed to ensure that the migration logic is correct. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2983