Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1837311ybi; Sat, 13 Jul 2019 01:26:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxBzxmiLBclnGVsr2bPNToGgTp7kHPTx3bGTHlpBB3ccemNSAlJp121u8OQkP/UnGqgQ1h X-Received: by 2002:a63:3d8d:: with SMTP id k135mr16098223pga.23.1563006394251; Sat, 13 Jul 2019 01:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563006394; cv=none; d=google.com; s=arc-20160816; b=Gj7iVwiQrEEVothxDx/Dzr9dLfgo8n3wgb5lD1QSHz/zZ0gC5YvA3dBC27F/+ewEhz nHlNDEbVbcjjtOXxa3KPJWnQSfp0T/4jwzk75pI0moP1EqN3wjeABx1/mnlsC3pLrYZP 4xIatZy2P/mcQfh2FLUuh0kjYZ4oa/uerf22CPLf3Qli/t4dJgYLYg+DYbKe7VbZcqGp 6jQpQXX8F63GuCd9kOqBQZillqL9i2sBREc3HsSc2gOnY2S3U0SbKeOUk+YH+M/ObvBj Kh49c2ud4Fx2VxjEqvI9LyZdyPMONj6+qEgNMrhqKLzR0qXHP+2GkpSRebkeyqRV1lwo 4Ktw== 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=6QTd4eX3sc1qUhKub9n3hlO3YZ/+QH5MhW+wPUN67nI=; b=FiGrJJVqzn+MmPkLd/b7Y9pUJ7fx7Gwk64uMI76o15Eur2e6hQfGeccMzSXNeyJYOz t1TZxck4WB0mzf3bMafr3o6LKSry3jMecoDGye8E5mxVv8BbeF2aYcVZs/4sXYNh23IB SjpEvixEXBmt7hw+bgul0+2SxNMoSwUSrDCTrV4pYOMOOE/iVauQH7OlZO+0SisKAdwz eqfD4TC+F2Q4Z6Ty1wj95G6UFVN/QJATvkDj6OkSyNXPyskJ/n25SqIMN1UlLXWfK5A0 FRuZKCv/30vJVWt8uP88uXK7B3qkObsTNMqy9BVbavYC+QujAXueG89h2hTLngfFW5ae FXow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VFMyJlnY; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si5275447pfo.59.2019.07.13.01.26.18; Sat, 13 Jul 2019 01:26:34 -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=@gmail.com header.s=20161025 header.b=VFMyJlnY; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727582AbfGMIZh (ORCPT + 99 others); Sat, 13 Jul 2019 04:25:37 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44397 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbfGMIZh (ORCPT ); Sat, 13 Jul 2019 04:25:37 -0400 Received: by mail-lj1-f193.google.com with SMTP id k18so11489792ljc.11 for ; Sat, 13 Jul 2019 01:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6QTd4eX3sc1qUhKub9n3hlO3YZ/+QH5MhW+wPUN67nI=; b=VFMyJlnY+HNmqN+/0XkHTCcE4XUlcWBudV8DdALA0mOHLcnTYnfBhIgHqG2Xia3xSO U+C7VUV0ICM2Hmaomy7KZ2TG1eODRaAmDL0dWsWvdt5A53muSbUu9XZkAGgJC5+LwetN lW8zno8kHgmXJnpTg0QCSv1xy5GT766oLuiTEqraYE9aijU6bOKyd61VOecp57itocUb uEaW5eY3ol9CwZOfno3tKtv/y4qBybA/MtM2HH/XVQgHgkbTRq+up5pN6UQN/lTs0L5h O7QG8D7CX18kqSuOrowDeVuMJ+jtN/IJaXZHniI7gtVawa9IIz+TkAy60/rj4ho1Fs03 ZWJA== 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=6QTd4eX3sc1qUhKub9n3hlO3YZ/+QH5MhW+wPUN67nI=; b=DO3RG9HQ4OeO4wSSV4WqfMoXSgNKsqNYBpmzlvS0U1ebia+nsNDFxqR8jhuTsEOst8 xMeTvU3FkhtUKoi7a8n8IyxNJIdj+53t/umEm6xzKvWmEXXYHrGi+g5nK/j1jzDkyEtP YRm5FmAv5lKwNFnTarT2oEKa06ON+MpOyLCP7bIb1zXGevmLV5l4CDHUHjcVLaqWFFDK 3H5ambObSGGVNdoeOynwUNKvZSJY+DFmPqslTEyCN1uCKED0MN1YgBNphvi1ywGOm7yr PkXOqkKFj2wqOz0imK8IqMhlP6txYmvk1Rp73ri/e/7c9uFkEdVPfum2zVJqt6DQZXN/ /5nw== X-Gm-Message-State: APjAAAWzG2TiGTVQTi/pNYo+pAxf/TSiypwoGhE6qFDsPCUfGXmR37aV 1MbYW8rFy8R1H1SVu6FStPJ35NE7FJVWWblfnQM= X-Received: by 2002:a2e:8ed2:: with SMTP id e18mr8207102ljl.235.1563006335346; Sat, 13 Jul 2019 01:25:35 -0700 (PDT) MIME-Version: 1.0 References: <20190712222118.108192-1-henryburns@google.com> In-Reply-To: <20190712222118.108192-1-henryburns@google.com> From: Vitaly Wool Date: Sat, 13 Jul 2019 10:24:30 +0200 Message-ID: Subject: Re: [PATCH] mm/z3fold.c: Allow __GFP_HIGHMEM in z3fold_alloc To: Henry Burns Cc: Andrew Morton , Vitaly Vul , Shakeel Butt , 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 Sat, Jul 13, 2019 at 12:22 AM 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 Acked-by: Vitaly Wool > --- > 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 >