Skip to content

Commit bbefa0f

Browse files
Kemeng Shiakpm00
authored andcommitted
mm/compaction: use correct list in move_freelist_{head}/{tail}
Patch series "Fixes and cleanups to compaction", v3. This is a series to do fix and clean up to compaction. Patch 1-2 fix and clean up freepage list operation. Patch 3-4 fix and clean up isolation of freepages Patch 7 factor code to check if compaction is needed for allocation order. More details can be found in respective patches. This patch (of 6): The freepage is chained with buddy_list in freelist head. Use buddy_list instead of lru to correct the list operation. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kemeng Shi <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Acked-by: Mel Gorman <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8a749fd commit bbefa0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/compaction.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,8 +1395,8 @@ move_freelist_head(struct list_head *freelist, struct page *freepage)
13951395
{
13961396
LIST_HEAD(sublist);
13971397

1398-
if (!list_is_last(freelist, &freepage->lru)) {
1399-
list_cut_before(&sublist, freelist, &freepage->lru);
1398+
if (!list_is_last(freelist, &freepage->buddy_list)) {
1399+
list_cut_before(&sublist, freelist, &freepage->buddy_list);
14001400
list_splice_tail(&sublist, freelist);
14011401
}
14021402
}
@@ -1412,8 +1412,8 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage)
14121412
{
14131413
LIST_HEAD(sublist);
14141414

1415-
if (!list_is_first(freelist, &freepage->lru)) {
1416-
list_cut_position(&sublist, freelist, &freepage->lru);
1415+
if (!list_is_first(freelist, &freepage->buddy_list)) {
1416+
list_cut_position(&sublist, freelist, &freepage->buddy_list);
14171417
list_splice_tail(&sublist, freelist);
14181418
}
14191419
}

0 commit comments

Comments
 (0)