[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM4kBBLC4Jo4TAC66XzJBgFZfF5ONgCNT5fPFQjwPJtug+5N8A@mail.gmail.com>
Date: Thu, 19 May 2022 09:12:14 +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 5/9] revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc"
On Fri, Apr 29, 2022 at 8:41 AM Miaohe Lin <linmiaohe@...wei.com> wrote:
>
> Revert commit f1549cb5ab2b ("mm/z3fold.c: allow __GFP_HIGHMEM in
> z3fold_alloc").
>
> z3fold can't support GFP_HIGHMEM page now. page_address is used
> directly at all places. Moreover, z3fold_header is on per cpu
> unbuddied list which could be access anytime. So we should rid
> the support of GFP_HIGHMEM allocation for z3fold.
Could you please clarify how kmem_cache is affected here?
Thanks,
Vitaly
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> mm/z3fold.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index b3b4e65c107f..5f5d5f1556be 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -212,10 +212,8 @@ static int size_to_chunks(size_t size)
> static inline struct z3fold_buddy_slots *alloc_slots(struct z3fold_pool *pool,
> gfp_t gfp)
> {
> - struct z3fold_buddy_slots *slots;
> -
> - slots = kmem_cache_zalloc(pool->c_handle,
> - (gfp & ~(__GFP_HIGHMEM | __GFP_MOVABLE)));
> + struct z3fold_buddy_slots *slots = kmem_cache_zalloc(pool->c_handle,
> + gfp);
>
> if (slots) {
> /* It will be freed separately in free_handle(). */
> @@ -1075,7 +1073,7 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp,
> enum buddy bud;
> bool can_sleep = gfpflags_allow_blocking(gfp);
>
> - if (!size)
> + if (!size || (gfp & __GFP_HIGHMEM))
> return -EINVAL;
>
> if (size > PAGE_SIZE)
> --
> 2.23.0
>
Powered by blists - more mailing lists