[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM4kBBLsbKrLgx1VtEikMGW7rCq5XF5pGVJF2hm_6NUPU6OBAQ@mail.gmail.com>
Date: Thu, 19 May 2022 09:13:12 +0200
From: Vitaly Wool <vitaly.wool@...sulko.com>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/9] mm/z3fold: put z3fold page back into unbuddied list
when reclaim or migration fails
On Fri, Apr 29, 2022 at 8:40 AM Miaohe Lin <linmiaohe@...wei.com> wrote:
>
> When doing z3fold page reclaim or migration, the page is removed from
> unbuddied list. If reclaim or migration succeeds, it's fine as page is
> released. But in case it fails, the page is not put back into unbuddied
> list now. The page will be leaked until next compaction work, reclaim
> or migration is done.
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> mm/z3fold.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index 5f5d5f1556be..a1c150fc8def 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -1422,6 +1422,8 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
> spin_lock(&pool->lock);
> list_add(&page->lru, &pool->lru);
> spin_unlock(&pool->lock);
> + if (list_empty(&zhdr->buddy))
> + add_to_unbuddied(pool, zhdr);
> z3fold_page_unlock(zhdr);
> clear_bit(PAGE_CLAIMED, &page->private);
> }
> @@ -1638,6 +1640,8 @@ static void z3fold_page_putback(struct page *page)
> spin_lock(&pool->lock);
> list_add(&page->lru, &pool->lru);
> spin_unlock(&pool->lock);
> + if (list_empty(&zhdr->buddy))
> + add_to_unbuddied(pool, zhdr);
> clear_bit(PAGE_CLAIMED, &page->private);
> z3fold_page_unlock(zhdr);
> }
Reviewed-by: Vitaly Wool <vitaly.wool@...sulko.com>
> --
> 2.23.0
>
Powered by blists - more mailing lists