Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1398007ybi; Fri, 12 Jul 2019 15:23:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6pf3ksoxHohHwhabc4Nn3r5ZPkznH2GOMb5BJluYDtIVpYU+9qgTwUR9+dE1/L8Y5J5/Y X-Received: by 2002:a17:90a:1904:: with SMTP id 4mr15145053pjg.116.1562970236299; Fri, 12 Jul 2019 15:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562970236; cv=none; d=google.com; s=arc-20160816; b=i2COVxqePRdfC1+FqNIHOujR2bOQ8jKL2jlN5WovqLXTw9FQ+zB/4J1WZxPj0n9sfe 0BqQiDmF6jijvklKyL9bAsHfra6NUGe+k1JA0iQT3D93thpi+3PF9/RJ8IIrQUNr6yRN zE15/WJPrF1pu41+Ni0f1hW2jKRw6Mcz6bL066L2jXEVFaHk3yvI70w80FV6RPPcNfIv nK3VavyUqXwczHho00HZusFNeENw/RZ0KdgZI3aLZ+bHzSxEG4cvFtvU5+eShjQdpWy2 PFvuOYBU6F27+niLB7a8ZYUIhvCJVOW3ttczcY5B0h/+CUo6h7qBtvtOANEHebTJ6QFd ECWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=kEx1JTVWGnPw7PBaID0vQzLE5AVxmop4HrGd6+u6kxc=; b=rbENB6IZz9dgvoNkAC9yous8qq8VnjpmCdLhZsnTZXU2lQ/b8Z3y6ymH3QAH04/WJp IMKIHmyZ8+8pKvXeigyMIx2QFBhN+ZWOLXU33pn1exttp8GxJvz4h31z9Wq5SN9B0Ge4 qJaX2gO898ORiXf+8g/skYeu/fTjcAwH4shvjexaDXKkST++0wTo6mhPcGqil8jjEsrG Has4j8KLwHE/sCLDbCcsF+AgmhZTgCeUoERzlrn+qJfswMP0De9GgeNO+GQJfmrKeFDD O0/qd+qtrCV18K36YDkuLu5NVbj4IVqidNrutIw1/rFrpFC4SPSrQOQBRFL/olWcPC/F /vqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qSqUpYgx; 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 f8si9994870pgi.191.2019.07.12.15.23.40; Fri, 12 Jul 2019 15:23:56 -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=qSqUpYgx; 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 S1728094AbfGLWW0 (ORCPT + 99 others); Fri, 12 Jul 2019 18:22:26 -0400 Received: from mail-vk1-f201.google.com ([209.85.221.201]:36135 "EHLO mail-vk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727245AbfGLWW0 (ORCPT ); Fri, 12 Jul 2019 18:22:26 -0400 Received: by mail-vk1-f201.google.com with SMTP id o75so2392522vke.3 for ; Fri, 12 Jul 2019 15:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=kEx1JTVWGnPw7PBaID0vQzLE5AVxmop4HrGd6+u6kxc=; b=qSqUpYgxDFOWLl7WX5ZMCvv2dnzMaJCqPuNXx+1t+LERJgI7++uG0ZO8RDFLJAvyCI 6vtlGj/aPA2PgSjWEt8UtsZ2xZdxNwmtf+811n5cci63SBJXhTeNlao84VjBtwx3aiTl s38YNeMwPr3A3vty/petaHAj8L8Cp0/4FFpjrNOxoaoFY0wMbu+pYKT24o7mxuljGGk1 3n0I9/ZcxrVJxkW7sWptnhLEWk3ERnQ1o+AXflBrA9HjWDQk8m55PwirzEGfHMLb1vh8 q7+siU7xerds1v9PduFCN+C6GGgZPfPvY7YYRFUuFFfJmz0Rx+3B38Y4gM9Pr7Gm2W8t rdAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=kEx1JTVWGnPw7PBaID0vQzLE5AVxmop4HrGd6+u6kxc=; b=Az3SvaA6YLT2qbwtOlKf5i3OiQPxwp+U2RC9nFFxTZDF8F773ddliKU0iKZiSp/FHn tf3RrE8MT81tb+OXBJ6AsyKetw8kpfmzD9cBvg3lHOQkHtwDNtWW4Ph3eYIDZHqKQi89 J4xRH8UFat2OHkgw4QYbo1smp2FegPWHyJKROURgKWHcRUy6xxMOOQ++nt4A/ILj6VFe LbcUyi7tg8jCo74iagq5VOQQg6X9ZfgXOv85hw9ANEt49y7HvWVFp+n1LKiDFxXWCcV7 B/8J/L5Iz7Iip0838uFq5nIz8CJDb7EqUa3UR547bplnKFjcJFf8kW33wrdtX718YR4T LiMg== X-Gm-Message-State: APjAAAX148R2UU8YQ3zECo0kjRLbpJmgbIhB/ToNye8w1xpR6sNupY2/ FKh9IIGI12f4/8KhA4271GP0z71U5fS6zWMS X-Received: by 2002:a1f:1d58:: with SMTP id d85mr6949921vkd.13.1562970145444; Fri, 12 Jul 2019 15:22:25 -0700 (PDT) Date: Fri, 12 Jul 2019 15:21:18 -0700 Message-Id: <20190712222118.108192-1-henryburns@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.510.g264f2c817a-goog Subject: [PATCH] mm/z3fold.c: Allow __GFP_HIGHMEM in z3fold_alloc From: Henry Burns To: Vitaly Wool , Andrew Morton Cc: Vitaly Vul , Shakeel Butt , Jonathan Adams , Greg Kroah-Hartman , Snild Dolkow , Thomas Gleixner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Henry Burns 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 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 --- 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