Bug 8680 - Fix some page allocation and migration BUGs
Summary: Fix some page allocation and migration BUGs
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: mm (show other bugs) mm
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: wangrongwei
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-01 21:02 UTC by wojiaohanliyang
Modified: 2024-04-01 21:10 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wojiaohanliyang hygon_group 2024-04-01 21:02:24 UTC
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:
Comment 1 小龙 admin 2024-04-01 21:10:16 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2983