Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: Henry Burns <henryburns@google.com>
To: Vitaly Wool <vitalywool@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Vitaly Vul <vitaly.vul@sony.com>,
	Shakeel Butt <shakeelb@google.com>,
	 Jonathan Adams <jwadams@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Snild Dolkow <snild@sony.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Henry Burns <henryburns@google.com>
Subject: [PATCH] mm/z3fold.c: Allow __GFP_HIGHMEM in z3fold_alloc
Date: Fri, 12 Jul 2019 15:21:18 -0700
Message-ID: <20190712222118.108192-1-henryburns@google.com> (raw)

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 <henryburns@google.com>
---
 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


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 22:21 Henry Burns [this message]
2019-07-13  8:24 ` Vitaly Wool
2019-07-13 16:05 ` Shakeel Butt

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190712222118.108192-1-henryburns@google.com \
    --to=henryburns@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwadams@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeelb@google.com \
    --cc=snild@sony.com \
    --cc=tglx@linutronix.de \
    --cc=vitaly.vul@sony.com \
    --cc=vitalywool@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org linux-mm@archiver.kernel.org
	public-inbox-index linux-mm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox