[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e326f0c6-a4dc-6788-7be7-a175c47b2249@arm.com>
Date: Wed, 28 Apr 2021 08:37:26 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org
Cc: ziy@...dia.com, william.kucharski@...cle.com, willy@...radead.org,
yang.shi@...ux.alibaba.com, aneesh.kumar@...ux.ibm.com,
rcampbell@...dia.com, songliubraving@...com,
kirill.shutemov@...ux.intel.com, riel@...riel.com,
hannes@...xchg.org, minchan@...nel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 2/5] mm/huge_memory.c: use page->deferred_list
On 4/27/21 7:02 PM, Miaohe Lin wrote:
> Now that we can represent the location of ->deferred_list instead of
> ->mapping + ->index, make use of it to improve readability.
Could you please explain how page->deferred_list and page->mapping
are interchangeable here ?
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> mm/huge_memory.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 63ed6b25deaa..76ca1eb2a223 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2868,7 +2868,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
> 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);
> @@ -2883,7 +2883,7 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
> 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 */
>
Powered by blists - more mailing lists