From patchwork Mon May 21 15:20:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10415627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4726260545 for ; Mon, 21 May 2018 15:23:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35D1328AC8 for ; Mon, 21 May 2018 15:23:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29DED28A80; Mon, 21 May 2018 15:23:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F053228B06 for ; Mon, 21 May 2018 15:21:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA7C86B000D; Mon, 21 May 2018 11:21:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C2E456B000E; Mon, 21 May 2018 11:21:34 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA7B96B0010; Mon, 21 May 2018 11:21:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id 671446B000D for ; Mon, 21 May 2018 11:21:34 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id r9-v6so4470747pgp.12 for ; Mon, 21 May 2018 08:21:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=Rg6BKxT24DTcq0T6rzs0UC5ZSOHr8p7gHnyYQom/FPU=; b=MzrMXc4tktTdhfmbHPah+7ItYOi2yA4CNHFsE7E8ffgHIzmvYbXjry3uL7MZ+3E+FS 27U/f0qJjSuMmh5a0puHiFkBFR5Pl/56+Ah7wGLXVkIDd/0NDrqbQBaMEAkUrEurGbQ8 inzHxqo9y3zxyIChPfMGQHVYj6lvTMGE83XhXwkxgVsd5B2IQBcweRU7slh76NaLWp2q Cq2b2+EkslgoLK1IkfXwkC9cmfyPRak7o9QpAka9JdDm1GNBnaAywUARFo/3rwBTyBWL MsTmY4FRdtjqJ2SfedK6o+dpAZEWjlTVQekNJdoHN7xyEwZ5K8LaZbJITFguoc2BZ+Zh L4bA== X-Gm-Message-State: ALKqPwcsarmv9rwkqws3UdwPOVqmfGjsHyUdHopUAQojIUlr2usnVI4V 48HxDoixyH2TQv4IveLMDj+/esopXcgjx2OhSNxBQq6kCrlYq6/YRoTfBkzllIa1TAOmBTnVaEi E/WzHEvFACPnJXJjs0fnpzO1+syX/33ffJfLjYE705T2/OlTv3l//LPjWfRhKpyx7qn7MJAb6gj hfA/oUgcFhy56wkAX6HTfDA+tLkQzAdaShb9sR6WlI36/J2NRdMQKfLP80CWQveOfHiSXYDDbPO 0Jt0V1GyT7XeYDS4DRjI3WP4NGFZGuj/W612XM3aHEuY+4xSvFjB5gHVrlOCNrRvKQDjMzGukCf 1CKrOtinx/MZGuZ2eqISwhVzSXvoOIWdK7jkAH+Iq2yNbfReXoQZ+bIqwPV84QtZp3ol/NttLX5 s X-Received: by 2002:a62:1549:: with SMTP id 70-v6mr20480601pfv.91.1526916094098; Mon, 21 May 2018 08:21:34 -0700 (PDT) X-Received: by 2002:a62:1549:: with SMTP id 70-v6mr20480566pfv.91.1526916093434; Mon, 21 May 2018 08:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526916093; cv=none; d=google.com; s=arc-20160816; b=QyWaldYJ9Prwg1mAM+xdliZkSnFseEF4upcU/ByRFVVENOIjdzxr5H/HNtXDItLZi4 HhUEghVlH/M3w/1A38bqrWla5lVrWzwz8w907tE7xoDzW/l160eB/kDtDfsMzyt8/bnC l/Bmp9VO773v4hf3f0bwQvwBK1Nz3u+FowbTpAH9lx3q9IU9UzAYhj+qG0CrinCXQmaJ h01ySs1AOybspaMwT/dV1G20mbLeuz2KouH2Qm2jk5HUfk4SloZhfFRY8BfwqBWJyiWi jAYpwktxhMYMIJCXPAABl/UFnO4Sl6Rijc5797aueQsqjhaw1RliYqJEXS6lcJ3ZpOzB e0Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Rg6BKxT24DTcq0T6rzs0UC5ZSOHr8p7gHnyYQom/FPU=; b=BrDHvqfuFtd7HVg1wk16C+ndKSCVgrVuPyAMweyFn8u1JAVEpWisBFI1/c1mBwed2W oxH+2+hH4UP8nn25Zp9S3rOFj5fAaO9iURUl/rLNS3DYQITFU6IQtBOApH/LDPsB8niw sUvtuPSTHllvaDX/efyYERuv/egH5gpDya5RxQICJQml8pqR+wbJDTKbICuTRhWLATTZ Xnx6i2qdpVMNpPqdWGgqeTLkZ5voI2LNge2BIYOEaZ8DPZD5ESGAG//n4fbDhz67qlB6 2O4D7DupLfNUkCY/L+lQSixbBdKjQcY+Wqu6VAnerPa2m5+uCNilIgpft24E3fGWy3sY lxWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rbwSmOsP; spf=pass (google.com: domain of yehs2007@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yehs2007@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k1-v6sor5378076pfh.35.2018.05.21.08.21.33 for (Google Transport Security); Mon, 21 May 2018 08:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of yehs2007@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rbwSmOsP; spf=pass (google.com: domain of yehs2007@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=yehs2007@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rg6BKxT24DTcq0T6rzs0UC5ZSOHr8p7gHnyYQom/FPU=; b=rbwSmOsPs6//Xdq0qX3YxRHouLglOtpjveDTLgYpSXnM/IqNqQ0xAa6S53z8ztyAof 2RPmLOmWTO3nEuIRLxLOX9Z0yg953yy1BufpcoYiBCe76q64YWh23xetvdw7/GU6QpwV liIILw1JY4sn/b2zLpaeojKBgXMRIZheoJHU0NSXSDiY9sWqmFmT326W8tV7zcr8Qhh1 gBQy5QnYSbf12lwHuoXsrne3KJef86f75mWf1AHDyL9u6WhchURMMSpJDRK3TDPaHQLd acF0wZldjYFL/Z8uODHMLMquW8OdMLo5Jjy0a+Nf5Q170Pbm+PlwCWXnj2e4QhrWDhbZ MGmg== X-Google-Smtp-Source: AB8JxZpd+VUeHXEfmUKTzkaAcy6nRUqAEQMkRUjG5Ow1Tl9xgeMQTm41T6DzPgvXTExphSx2MkLfuA== X-Received: by 2002:a62:ecdc:: with SMTP id e89-v6mr20557296pfm.33.1526916093211; Mon, 21 May 2018 08:21:33 -0700 (PDT) Received: from localhost.localdomain ([125.33.105.40]) by smtp.gmail.com with ESMTPSA id t14-v6sm30844344pfh.109.2018.05.21.08.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 08:21:32 -0700 (PDT) From: Huaisheng Ye To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: mhocko@suse.com, willy@infradead.org, vbabka@suse.cz, mgorman@techsingularity.net, kstewart@linuxfoundation.org, alexander.levin@verizon.com, gregkh@linuxfoundation.org, colyli@suse.de, chengnt@lenovo.com, hehy1@lenovo.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-btrfs@vger.kernel.org, Huaisheng Ye , Minchan Kim , Nitin Gupta , Sergey Senozhatsky Subject: [RFC PATCH v2 10/12] mm/zsmalloc: update usage of address zone modifiers Date: Mon, 21 May 2018 23:20:31 +0800 Message-Id: <1526916033-4877-11-git-send-email-yehs2007@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526916033-4877-1-git-send-email-yehs2007@gmail.com> References: <1526916033-4877-1-git-send-email-yehs2007@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye Use __GFP_ZONE_MOVABLE to replace (__GFP_HIGHMEM | __GFP_MOVABLE). ___GFP_DMA, ___GFP_HIGHMEM and ___GFP_DMA32 have been deleted from GFP bitmasks, the bottom three bits of GFP mask is reserved for storing encoded zone number. __GFP_ZONE_MOVABLE contains encoded ZONE_MOVABLE and __GFP_MOVABLE flag. With GFP_ZONE_TABLE, __GFP_HIGHMEM ORing __GFP_MOVABLE means gfp_zone should return ZONE_MOVABLE. In order to keep that compatible with GFP_ZONE_TABLE, replace (__GFP_HIGHMEM | __GFP_MOVABLE) with __GFP_ZONE_MOVABLE. Signed-off-by: Huaisheng Ye Cc: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky --- mm/zsmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index c301350..06b2902 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -343,7 +343,7 @@ static void destroy_cache(struct zs_pool *pool) static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) { return (unsigned long)kmem_cache_alloc(pool->handle_cachep, - gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE)); + gfp & ~__GFP_ZONE_MOVABLE); } static void cache_free_handle(struct zs_pool *pool, unsigned long handle) @@ -354,7 +354,7 @@ static void cache_free_handle(struct zs_pool *pool, unsigned long handle) static struct zspage *cache_alloc_zspage(struct zs_pool *pool, gfp_t flags) { return kmem_cache_alloc(pool->zspage_cachep, - flags & ~(__GFP_HIGHMEM|__GFP_MOVABLE)); + flags & ~__GFP_ZONE_MOVABLE); } static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage)