Commit dac2a4f
mm/hugetlb: copy the CMA flag when demoting
Since commit d2d7867 ("mm/hugetlb: enable bootmem allocation from CMA
areas"), a flag is used to mark hugetlb folios as allocated from CMA.
This flag is also used to decide if it should be freed to CMA.
However, the flag isn't copied to the smaller folios when a hugetlb folio
is broken up for demotion, which would cause it to be freed incorrectly.
Fix this by copying the flag to the smaller order hugetlb pages created
from the original one.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: d2d7867 ("mm/hugetlb: enable bootmem allocation from CMA areas")
Signed-off-by: Frank van der Linden <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Reviewed-by: Jane Chu <[email protected]>
Cc: Muchun Song <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 9a9794a commit dac2a4f
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4034 | 4034 | | |
4035 | 4035 | | |
4036 | 4036 | | |
| 4037 | + | |
4037 | 4038 | | |
4038 | 4039 | | |
4039 | 4040 | | |
4040 | 4041 | | |
| 4042 | + | |
| 4043 | + | |
4041 | 4044 | | |
4042 | 4045 | | |
4043 | 4046 | | |
| |||
4053 | 4056 | | |
4054 | 4057 | | |
4055 | 4058 | | |
| 4059 | + | |
| 4060 | + | |
| 4061 | + | |
4056 | 4062 | | |
4057 | 4063 | | |
4058 | 4064 | | |
| |||
0 commit comments