# \[patch 013/192\] mm/huge\_memory.c: use page-\>deferred\_list

- From: Andrew Morton \<akpm@linux-foundation.org\>
- Date: 2021-07-01 01:47:49 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/07/6509406
- Thread: https://ratatoskr.run/linux-mm/2021/07/6509393/t.md

```text
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: 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 <redacted>
Reviewed-by: David Hildenbrand <redacted>
Cc: Alexey Dobriyan <redacted>
Cc: "Aneesh Kumar K . V" <redacted>
Cc: Anshuman Khandual <redacted>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kirill A. Shutemov <redacted>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Ralph Campbell <redacted>
Cc: Rik van Riel <riel@surriel.com>
Cc: Song Liu <redacted>
Cc: William Kucharski <redacted>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Mike Kravetz <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/huge_memory.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/huge_memory.c~mm-huge_memoryc-use-page-deferred_list
+++ a/mm/huge_memory.c
@@ -2870,7 +2870,7 @@ static unsigned long deferred_split_scan
 	spin_lock_irqsave(&ds_queue->split_queue_lock, flags);
 	/* Take pin on all head pages to avoid freeing them under us */
 	list_for_each_safe(pos, next, &ds_queue->split_queue) {
-		page = list_entry((void *)pos, struct page, mapping);
+		page = list_entry((void *)pos, struct page, deferred_list);
 		page = compound_head(page);
 		if (get_page_unless_zero(page)) {
 			list_move(page_deferred_list(page), &list);
@@ -2885,7 +2885,7 @@ static unsigned long deferred_split_scan
 	spin_unlock_irqrestore(&ds_queue->split_queue_lock, flags);
 
 	list_for_each_safe(pos, next, &list) {
-		page = list_entry((void *)pos, struct page, mapping);
+		page = list_entry((void *)pos, struct page, deferred_list);
 		if (!trylock_page(page))
 			goto next;
 		/* split_huge_page() removes page from list on success */
_

```
