From patchwork Wed May 23 16:57:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10421929 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 E07FD60327 for ; Wed, 23 May 2018 16:57:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D112729069 for ; Wed, 23 May 2018 16:57:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C581C2906E; Wed, 23 May 2018 16:57:32 +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 EAEE929069 for ; Wed, 23 May 2018 16:57:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BD7E6B026C; Wed, 23 May 2018 12:57:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 945F86B026D; Wed, 23 May 2018 12:57:30 -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 7E7CB6B026E; Wed, 23 May 2018 12:57:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 350436B026C for ; Wed, 23 May 2018 12:57:30 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id q71-v6so3571898pgq.17 for ; Wed, 23 May 2018 09:57:30 -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; bh=Z+Hp2HigyhAfBzbV1OsZioErAyia3+K3lQBUDz4F474=; b=BpvT5j+b/knVBRFMs3bztXdzcw7HgYslaaoWkFTeIxp4rMorR2dUR4jYkaC2blpeML erhntK0jlZyJrWAHY8yMhZTE82Ie9cETDo4t0YBAUdU6pHwd6m8GgPq3DZv4Jw5c6iUj YmXhkzVdllhTT08XCcWQ85OOy9jYu+HebnDssmAsZg4O2Kf7WvVYaD6q7jJU6Qw8XPqw oK4gTQh7mzoux7wSZwQrq9YHcgCl0Z66wo0WvxugbDu0OWUIZBd4WrQggM2iSQrNDCuV UpJmnX6kb3EARF0hxeBwKswXHOTcKZNaRzAh6hSKVpjQhy07jgdTkdlsnFGLjTOpqCyL dw7g== X-Gm-Message-State: ALKqPwfMo/J9SUp2qHmA+IC3RcbMbOO4ZGaC/3Tq8KEbrp1mbSAmZ2nT 5mP1t0rQE9hYLsgfZeuD6OYLcdt98fcIU7V1GITExuYAplnblbW3v6bTishdRi5gkTJ2UtOy+G3 65ygMM/6t8KOSXfZypmAiFdcZYBF+hE88yvZtLdFc8aH34gYLDaigLHqRfMeHSRrE8XN1NSwgrv h6cGHgdQ4n9g+eWd4sJKdtemSqfZZrS/cbLEh8j4Q9xaX5VMEsJicdwLXXMr2txZatmkPoq42Kr +MEDEHaDYdhF6h/L+rWMd2If4kFfRShTYzymTGCovCK9SQXw+cf0i7u9uK1/SWAVpjiC6dlE9T7 5tCdePg/o5SVbEE0OcjXtI5K3qhxVk2SdW7gSR6Eo5RvPmRsXtvyzfqIT8jAv2APblY2F5uy3V7 K X-Received: by 2002:a17:902:bf4a:: with SMTP id u10-v6mr3817238pls.322.1527094649892; Wed, 23 May 2018 09:57:29 -0700 (PDT) X-Received: by 2002:a17:902:bf4a:: with SMTP id u10-v6mr3817185pls.322.1527094648923; Wed, 23 May 2018 09:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527094648; cv=none; d=google.com; s=arc-20160816; b=eCfEIRn9cM7i4JIGlYhP/gSR8uEcK2cneHcv6okD3c6j+Qy9eL2e/9E71/2QY0W6zE dG3pH9ROB97t/IclesezgLuWkNP9MP9SAr/yuu7uEbrOxsd/0yygeoaQaRSq7L0yvgCH SKUSSGoUAb9uc7DTidrm3/F1qRBddwTjqUfMRM4ST4noswhZ1ULb8nskwBjtud+Um0Lt 8UuAn0PVYSQwTW/p5R8a1k1zhkhJddC4Nk9iRwbLjpxld9j1W0YCiLa4N3tTaJFvyt9J 7R4hkh7dlZyaFBwrMkXKCdeFyYKe/J+3h7Kj4mICCJSvViLbsHFKFIGVx0MkayRlQvTe 8+NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Z+Hp2HigyhAfBzbV1OsZioErAyia3+K3lQBUDz4F474=; b=Ubt9rHF5Xka7ZoOVT7Ma8rMsEg6DZdJxlmuMEbLnInHcEHObCLmlJJJnZ41hb8aahF 00PQSmXAf7wLB/Z7ce8FTA2roPp4AYFif/8sKGn+QvwIIk0SHE6maRPzugC8elP1EnS+ ayFtpNOD3dpFw4Fx7AmUuU78B6wcmB5jcjv95OAY/2L+DItNM8SCO1SO6MeiirZRqXK8 jO2s8qN40L5Fz4iP2IgTbBUG5HKrOU3G/Q1CHnRVMTV3J4blTu/yzT4AtVmfNMC6hyRU 3OPjLoOXRnbXWPigc3xrn4j2BEMCua1Yk9LYh0eTGqO4yVcFHRJVHW9+JhSQ1Y5407P6 /+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=io7C0Agu; 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 x5-v6sor4665634pgr.94.2018.05.23.09.57.28 for (Google Transport Security); Wed, 23 May 2018 09:57:28 -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=io7C0Agu; 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; bh=Z+Hp2HigyhAfBzbV1OsZioErAyia3+K3lQBUDz4F474=; b=io7C0AguHjyry9V8x9pXgA/KQfElJxJSudstZOJNgFrhpg6DI7rKV64SHIVY3csIoA TAodSoXxnxh/tnMO60LastbVG0gnu/O+6LNoOXSsCAi9uuvffesIU/Ck1Af2yMoKgfZZ F2gHMx3X8EfHzeDZkl3xFshsk0G6czrxeuDGgkBqXqnVnWuaOiz72DIUmaVeGR5UySXz 7SImIITlInkZQMpt4AFrQEJ73ncnnuF6iOqGXXxTwQcXCupYiJey2eNAqsG8rtL8MW5u CSOt9NQIaPKfCNijGZPZegbIbfTl9XQQzwvZDRnjI3vtKebo5nyhRQCcGMZyv8D1RZsd 0OIg== X-Google-Smtp-Source: AB8JxZqbj5Q3xQAbX8ReUaBVAZj3WTbqXEoSTPx58DnWfGhpBKQMDseTUADk9iM2jfO6EUK/iA/N0Q== X-Received: by 2002:a65:590e:: with SMTP id f14-v6mr2943581pgu.282.1527094648694; Wed, 23 May 2018 09:57:28 -0700 (PDT) Received: from localhost.localdomain ([123.120.56.60]) by smtp.gmail.com with ESMTPSA id j1-v6sm31995020pfh.95.2018.05.23.09.57.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 09:57:28 -0700 (PDT) From: Huaisheng Ye To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: mhocko@suse.com, willy@infradead.org, hch@lst.de, vbabka@suse.cz, mgorman@techsingularity.net, kstewart@linuxfoundation.org, 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 , Chris Mason , Josef Bacik , David Sterba , Christoph Hellwig Subject: [RFC PATCH v3 4/9] fs/btrfs/extent_io: update usage of zone modifiers Date: Thu, 24 May 2018 00:57:19 +0800 Message-Id: <1527094639-4562-1-git-send-email-yehs2007@gmail.com> X-Mailer: git-send-email 1.8.3.1 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_MASK to replace (__GFP_DMA32 | __GFP_HIGHMEM). In function alloc_extent_state, it is obvious that __GFP_DMA is not the expecting zone type. ___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_DMA, __GFP_HIGHMEM and __GFP_DMA32 should not be operated with each others by OR. Use GFP_NORMAL() to clear bottom 3 bits of GFP bitmaks. Signed-off-by: Huaisheng Ye Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: Christoph Hellwig --- fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e99b329..f41fc61 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -220,7 +220,7 @@ static struct extent_state *alloc_extent_state(gfp_t mask) * The given mask might be not appropriate for the slab allocator, * drop the unsupported bits */ - mask &= ~(__GFP_DMA32|__GFP_HIGHMEM); + mask = GFP_NORMAL(mask); state = kmem_cache_alloc(extent_state_cache, mask); if (!state) return state;