[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221027033641.66709-1-songmuchun@bytedance.com>
Date: Thu, 27 Oct 2022 11:36:41 +0800
From: Muchun Song <songmuchun@...edance.com>
To: mike.kravetz@...cle.com, muchun.song@...ux.dev,
akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Muchun Song <songmuchun@...edance.com>
Subject: [PATCH] mm: hugetlb_vmemmap: remove redundant list_del()
The ->lru field will be assigned to a new value in __free_page().
So it is unnecessary to delete it from the @list. Just remove it
to simplify the code.
Signed-off-by: Muchun Song <songmuchun@...edance.com>
---
mm/hugetlb_vmemmap.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index 20f414c0379f..c98805d5b815 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -231,10 +231,8 @@ static void free_vmemmap_page_list(struct list_head *list)
{
struct page *page, *next;
- list_for_each_entry_safe(page, next, list, lru) {
- list_del(&page->lru);
+ list_for_each_entry_safe(page, next, list, lru)
free_vmemmap_page(page);
- }
}
static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
--
2.11.0
Powered by blists - more mailing lists