From patchwork Mon May 21 15:20:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10415615 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 8081B60365 for ; Mon, 21 May 2018 15:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F2C728B81 for ; Mon, 21 May 2018 15:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DD7628B96; Mon, 21 May 2018 15:21:57 +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 2B04828B96 for ; Mon, 21 May 2018 15:21:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E07EC6B000A; Mon, 21 May 2018 11:21:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D8D726B000C; Mon, 21 May 2018 11:21:03 -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 C0A856B000D; Mon, 21 May 2018 11:21:03 -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 7DA076B000A for ; Mon, 21 May 2018 11:21:03 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id e18-v6so4524959pgt.3 for ; Mon, 21 May 2018 08:21:03 -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=gCVeji/sj287tYAdssy/5sld4ZpSGcCIq6efDVH4m0A=; b=D6dBbS1noFyJBw9vJIJhzP6F1vzrCnIFOvVIdcWR0QFTttKkUOMZYj6wea/0szOXh9 UvTitlf8HBKkf3NR9tiWslEW38IDXrvqppp4fMHQk2gBrhUVeVANvxvBhkTOEXHpQQIQ mdeAZQtu4Jor5n0evabJNVdsawBsYHuJIzox651JsWbgUPbCNvYwG21DWmOGRFCWbORZ z7yofMvBc94NKNOcj+Uts5fNMBqBYhagasRBnLt5As8/V5G17bFPrHQ53MRvlyMe2JOf O/UyBuCALGwwNenAkFYDkFcMHFdiv60Uzzj9WW+slQz15UDgN1a1vsNuEB9G6ejMldKk Hvjg== X-Gm-Message-State: ALKqPwfUJ0brEbEM0QNxQKo9T71veCd0Exqp/H+4z9eQdxGOQtsa+i6C Bw7mG4pcaboA5sQkx7A6m5uMiSFozrM+wM9XF9R6y8czQyFe1KiINs2BaDmjMTNoj5lIP7243gD m9Tdzb8dTUUhcYRDLgleGdssA2WlItCCvwS43UfvJGqTNW5JatluT/+R5RvqcgQPmC42xKH1o9c RD8TyiKgqcEiSCVp2p+rAY9G3cW37SzqlJ9dM5jeRT5zZj5cUBkLPFEM1TOU/LZmB4q0819IO0g 4SDw366OnOPJ06I2La12JLguV0bR2JoP3bi8+N/tZmW32dYzm4mjttG+v7LPBvJBcFKMTnghtVR MrxKvmIrMkhszohzsy1vT9Fo8DaO3z4uj17mUNHX9pbPWg+SdQXrvFjYYOaVg/qDdaiXhZYpPhR N X-Received: by 2002:a62:8605:: with SMTP id x5-v6mr20394164pfd.103.1526916063203; Mon, 21 May 2018 08:21:03 -0700 (PDT) X-Received: by 2002:a62:8605:: with SMTP id x5-v6mr20394120pfd.103.1526916062451; Mon, 21 May 2018 08:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526916062; cv=none; d=google.com; s=arc-20160816; b=uornIIXRrm4ZuVu2zfPfMrCpk1hN8d9KP4B7BHG/4R788iRw9N5p6h3B9rsZwgZtsp q4RMykgJ6hlcbzMzygsfshrJ2Tu+49pYq+BMObAgktY6fVxMXUY6yHEWbwWEOsnzXijG lK/4g3+f9+PAKnAvnyBAj3VLX9FD5sFcJ9FnPC2pCNsJOQHbIUZCB/IfpujUw2c5hNhC eAbp7Khuk+N5gdooj5ubsO1esTsHcDhFNBW20cY5XNAcklZhN0SwqcxV/pVfUkEh5A1o GLfkLjGt5y5+FtApYKlTcVY45T5oad0rS4cRi9mCF0yJ1/AYtNDxb8Cg3ZemLT/iERaV WBSw== 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=gCVeji/sj287tYAdssy/5sld4ZpSGcCIq6efDVH4m0A=; b=REpKZplH5Va2x7/SYq2Y06jDF3/0unIbfJctK88791tU0GF1tM8mTR4qcb7ovmwHFC htQRcqL5J5GZleVSqUZ5nd3J80SdQ38AtQBrfHmyszt92I/K/jydafYdM+660x+LHEKo 3XzjB+QzehRvo/X0BOl/IE3nRuyrWsvDA0wKz+INE1kl6Ju8IFeLbwajqZX1FOyvLqyn LgmRs45e75WcQC84y859/ekOrhPKh19GUYybJRNepiaTTmTdIVFDsc0oQYzHERi/WKEz uwDCFwGZlZl8dFLK0VJPszfZa44+SzNl7b6HrFdGjoiBHkYC2YuH1U38yTV0k+8GRibq PoHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BXvzDbOh; 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 f22-v6sor5898886pff.41.2018.05.21.08.21.02 for (Google Transport Security); Mon, 21 May 2018 08:21:02 -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=BXvzDbOh; 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=gCVeji/sj287tYAdssy/5sld4ZpSGcCIq6efDVH4m0A=; b=BXvzDbOhgTTupQjFciYLyk8d0/yYwpFMbuz3zpD2qo17Eqc+MVaVA9p92EELGC4L2z f92f66WKY5M2e57DUdpzGrwJYsyT2nHTSNeyCpJg3v6vu6OqfAK8G2JrwrnUUT78QL/t vOIY+3Wc2ntN1L0OIOFmDuapA8Sxkt1zf6mbV7nfrHiK/OtrHxlz5tH0Mwpg25jdODVD +HeNHR3xT9owX6NYzc2UMsyl5LhH94zbo2tL0KdS3HVdPuE6K+xYrEKo/OjAHJJEr7cx jUnD9YwuQcAuzk13wmG2WhrnO+nmCYumj0f9irDVU1uuf5V05jdTaP+Cm4E3UReoxj1K 8SmA== X-Google-Smtp-Source: AB8JxZrAVYVwjqdf6R5rZmASog1IIgq3LzXj6kL3m/+HAwjZcmaBn+BSUjHEhS8RpB2wn2D7TxjLPg== X-Received: by 2002:a62:9fca:: with SMTP id v71-v6mr20423139pfk.233.1526916062212; Mon, 21 May 2018 08:21:02 -0700 (PDT) Received: from localhost.localdomain ([125.33.105.40]) by smtp.gmail.com with ESMTPSA id t14-v6sm30844344pfh.109.2018.05.21.08.20.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 08:21:01 -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 , Joerg Roedel Subject: [RFC PATCH v2 04/12] drivers/iommu/amd_iommu: update usage of address zone modifiers Date: Mon, 21 May 2018 23:20:25 +0800 Message-Id: <1526916033-4877-5-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_MASK to replace (__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32). ___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 by OR. Signed-off-by: Huaisheng Ye Cc: Joerg Roedel --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 74788fd..3921d53 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2614,7 +2614,7 @@ static void *alloc_coherent(struct device *dev, size_t size, dma_dom = to_dma_ops_domain(domain); size = PAGE_ALIGN(size); dma_mask = dev->coherent_dma_mask; - flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); + flag &= ~__GFP_ZONE_MASK; flag |= __GFP_ZERO; page = alloc_pages(flag | __GFP_NOWARN, get_order(size));