* [PATCH] mm: hugetlb_vmemmap: remove redundant list_del()
@ 2022-10-27 3:36 Muchun Song
2022-10-27 18:53 ` Mike Kravetz
0 siblings, 1 reply; 2+ messages in thread
From: Muchun Song @ 2022-10-27 3:36 UTC (permalink / raw)
To: mike.kravetz, muchun.song, akpm; +Cc: linux-mm, linux-kernel, Muchun Song
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@bytedance.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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: hugetlb_vmemmap: remove redundant list_del()
2022-10-27 3:36 [PATCH] mm: hugetlb_vmemmap: remove redundant list_del() Muchun Song
@ 2022-10-27 18:53 ` Mike Kravetz
0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2022-10-27 18:53 UTC (permalink / raw)
To: Muchun Song; +Cc: muchun.song, akpm, linux-mm, linux-kernel
On 10/27/22 11:36, Muchun Song wrote:
> 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@bytedance.com>
> ---
> mm/hugetlb_vmemmap.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Thanks,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
>
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-27 18:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 3:36 [PATCH] mm: hugetlb_vmemmap: remove redundant list_del() Muchun Song
2022-10-27 18:53 ` Mike Kravetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox