Skip to content

Commit dfe5c51

Browse files
MiaoheLintorvalds
authored andcommitted
mm/huge_memory.c: use page->deferred_list
Now that we can represent the location of ->deferred_list instead of ->mapping + ->index, make use of it to improve readability. Link: https://lkml.kernel.org/r/20210511134857.1581273-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Yang Shi <shy828301@gmail.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Ralph Campbell <rcampbell@nvidia.com> Cc: Rik van Riel <riel@surriel.com> Cc: Song Liu <songliubraving@fb.com> Cc: William Kucharski <william.kucharski@oracle.com> Cc: Zi Yan <ziy@nvidia.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b2bd53f commit dfe5c51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/huge_memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,7 +2870,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
28702870
spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
28712871
/* Take pin on all head pages to avoid freeing them under us */
28722872
list_for_each_safe(pos, next, &ds_queue->split_queue) {
2873-
page = list_entry((void *)pos, struct page, mapping);
2873+
page = list_entry((void *)pos, struct page, deferred_list);
28742874
page = compound_head(page);
28752875
if (get_page_unless_zero(page)) {
28762876
list_move(page_deferred_list(page), &list);
@@ -2885,7 +2885,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
28852885
spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
28862886

28872887
list_for_each_safe(pos, next, &list) {
2888-
page = list_entry((void *)pos, struct page, mapping);
2888+
page = list_entry((void *)pos, struct page, deferred_list);
28892889
if (!trylock_page(page))
28902890
goto next;
28912891
/* split_huge_page() removes page from list on success */

0 commit comments

Comments
 (0)