Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2209744ybi; Sat, 13 Jul 2019 09:07:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzI/Y1eSE5e32GYRh3zqN97jdYjoSZZI8dS92ERTaT824c00yM6JqJ8oc3PRlII0of2+q/F X-Received: by 2002:a63:5d45:: with SMTP id o5mr17780833pgm.40.1563034073495; Sat, 13 Jul 2019 09:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563034073; cv=none; d=google.com; s=arc-20160816; b=TsTqD+0TVzPzzzRMtfIx6dp6HX9MnN4eo90Wwv2sq8wec3RYcXqlOg8Lv3YLPqLbPJ yz65kdvphTVE5qvmEleYls0rFbJK32G4hV+XDcGUj0vDreenU4/3sMICe25vx0ueVny/ EOfWMxV8nErU1qrzGKKzvIdIjJgIbAHWbuoHxzAZG/5Scldx8E/qySrhg10sitl+G5va gzqbPGBXJxDx925za6E5fcxGYM2l27k20awMMxz5Ba5lyXzQvGY+aLWGsHqGqB13cEy6 9xOHQG8naPdwqd+k7XaIu+dJyCXGRaBaCYO8unirmYAgxJiulOqhdN67z/lzRqn6CBpC YwBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7mk75n+FUSNUhfgNLft7JljlbXBUa7UOYFFMLEx7Ozk=; b=yUFS+eNulRcsI9M8ypSC9P+FvsyG4uZA0AASX5EPXqDok9HfeformErImQM394CC7m anU6KD68WR0pfr0X1olLm6A4k/39nOIwcSkj2FsBlLnrcOTZ0OXojcKdkn4jSXekOSm7 A1p6S49vSDeuSxhwGB2vFmDXGigZ5LLN0ND3706C0wtCfXCmvRFtnrQyQxP/gPLzPBGY iC6M5ligfg31MJqM1zzXR5QtiHj16bF4wm0/onBQaINS2LdFEp4RPwg9/aLWTIorZt+N GAieCSNdopMIDIbET6zTK/W/p/FRqdG7gWD9vSIcp24OwMXdMwlLbX911sGrc3eAl0ix a4ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Ke7ejz/m"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x22si11324410pln.150.2019.07.13.09.07.35; Sat, 13 Jul 2019 09:07:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Ke7ejz/m"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728043AbfGMQFk (ORCPT + 99 others); Sat, 13 Jul 2019 12:05:40 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:40960 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727809AbfGMQFk (ORCPT ); Sat, 13 Jul 2019 12:05:40 -0400 Received: by mail-yw1-f66.google.com with SMTP id i138so6026627ywg.8 for ; Sat, 13 Jul 2019 09:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7mk75n+FUSNUhfgNLft7JljlbXBUa7UOYFFMLEx7Ozk=; b=Ke7ejz/mT3GEgJN7v5rXdKwDCBjN3gI3AqIh2t3dAPhMi1tnB4DK9+xAh2bGEj87DO rxxRS3AJMRuw4LR41VnOligTxXk/T19Ijnvu09+BkEHY1n5xCxJvKJfzDH0BgVXcNZ6T mzcNez1i5WrwxW/9eeJgRRwyin8scGj1bIXKiZKcWXCKnld5Tqu37+Fs7ygYRKgHCoBf WZXUTvuYWLyojeuWyB4UpfZHfYEEiy7m2bFzcJh8VYB5MRdRpBhWqJcZqI8mvEwo4F2A ajjjKT58t0Mcrl6hEkZiWAnhtZoCuwscYs4FkPqbHOhSgFEB3O4Tyv6TlNA+7ewxGb0f RzWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7mk75n+FUSNUhfgNLft7JljlbXBUa7UOYFFMLEx7Ozk=; b=dWP2BTjnaqvvu8FNQEwu0eFE0JDuqDLEtT79DhE2XB4t3829Fu15e+Nx43Rmc+2tR6 i1aRq30WE8+uIYPnqROvyB4tryXSmOu8XwrvBpMfJQNPLaJhpSMefh9N3MC8+/p7kjO/ 4vfePy/RXXaf4zogjy//Z+WPmQyaQ5laEZ6fzJqncLfbhCFIq+ugYown6Os+LL2XkB/7 rbC1xx215k/tWYI6xFs0XXwxdqF5HfF+W6Jf/dg9WUV9KJOzav8jliv3F8mQrfPs/1aV T5bfjM4WSZmXvuvNGFUUS6i4KcO5jatqW9nIAF2DCd7g0Hiyzi8OY24dC5yA8tl+1Huy hkzw== X-Gm-Message-State: APjAAAXq9/SlJoQgn5tYTLqFeGy0FnsR7P+vguN9gPUNGYG352IGCYCj /+QAYCwcHSMPjWS2Spe9JcAxVgzhf3ctzqDm2FYHzA== X-Received: by 2002:a0d:c345:: with SMTP id f66mr9597066ywd.10.1563033938757; Sat, 13 Jul 2019 09:05:38 -0700 (PDT) MIME-Version: 1.0 References: <20190712222118.108192-1-henryburns@google.com> In-Reply-To: <20190712222118.108192-1-henryburns@google.com> From: Shakeel Butt Date: Sat, 13 Jul 2019 09:05:27 -0700 Message-ID: Subject: Re: [PATCH] mm/z3fold.c: Allow __GFP_HIGHMEM in z3fold_alloc To: Henry Burns Cc: Vitaly Wool , Andrew Morton , Vitaly Vul , Jonathan Adams , Greg Kroah-Hartman , Snild Dolkow , Thomas Gleixner , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 12, 2019 at 3:22 PM Henry Burns wrote: > > One of the gfp flags used to show that a page is movable is > __GFP_HIGHMEM. Currently z3fold_alloc() fails when __GFP_HIGHMEM is > passed. Now that z3fold pages are movable, we allow __GFP_HIGHMEM. We > strip the movability related flags from the call to kmem_cache_alloc() > for our slots since it is a kernel allocation. > > Signed-off-by: Henry Burns Reviewed-by: Shakeel Butt > --- > mm/z3fold.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/mm/z3fold.c b/mm/z3fold.c > index e78f95284d7c..cb567ddf051c 100644 > --- a/mm/z3fold.c > +++ b/mm/z3fold.c > @@ -193,7 +193,8 @@ static inline struct z3fold_buddy_slots *alloc_slots(struct z3fold_pool *pool, > gfp_t gfp) > { > struct z3fold_buddy_slots *slots = kmem_cache_alloc(pool->c_handle, > - gfp); > + (gfp & ~(__GFP_HIGHMEM > + | __GFP_MOVABLE))); > > if (slots) { > memset(slots->slot, 0, sizeof(slots->slot)); > @@ -844,7 +845,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 || (gfp & __GFP_HIGHMEM)) > + if (!size) > return -EINVAL; > > if (size > PAGE_SIZE) > -- > 2.22.0.510.g264f2c817a-goog >