Skip to content

Commit

Permalink
revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc"
Browse files Browse the repository at this point in the history
Revert commit f1549cb ("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 accessed anytime.  So we should remove the support of GFP_HIGHMEM
allocation for z3fold.

Link: https://lkml.kernel.org/r/20220429064051.61552-6-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Miaohe Lin authored and akpm committed May 27, 2022
1 parent 2c0f351 commit f4bad64
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(). */
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f4bad64

Please sign in to comment.