From patchwork Wed May 23 16:53:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10421923 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 EF6906053B for ; Wed, 23 May 2018 16:53:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E00482236A for ; Wed, 23 May 2018 16:53:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D422F28382; Wed, 23 May 2018 16:53:30 +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 43EDD22701 for ; Wed, 23 May 2018 16:53:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA5526B0266; Wed, 23 May 2018 12:53:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C56336B026A; Wed, 23 May 2018 12:53:28 -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 B6D396B026C; Wed, 23 May 2018 12:53:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id 7590F6B0266 for ; Wed, 23 May 2018 12:53:28 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id q16-v6so14527398pls.15 for ; Wed, 23 May 2018 09:53:28 -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=8/t417FnqhBat11TkBfILMDFDjbYbPRlaltf7n39kN0=; b=MJ9V8YhapMz8/GpPFyAEscJBxMuF7uQmzMHZ5886uov/vNk2+r4bhcveIiZ8T7rom2 Y2bCg0vi1z66o0K53sGsOboLutDDWad5ATOarF0BD0zATT60pHBRFK/TJIHtUvDYnQD8 pRx/ipkvV2X4XmFtvjeFLBkr9Sa5+XN5sOK78Y+k5XLqff9X6Xae60aVoz79o1V5gTMN UuZBMpk90Z/LNfsvjsSqL5sTnB0/7cq7/5g0d6Zp8z0TFKqO110nQcFb24/3v/MsP9n5 zAzkJBQiJgSZfU3eyj/P1tYHo4JXP0LZ8zvST9zSuMn/FVZR0bE2GniuycrJx3UYj3A4 zwEA== X-Gm-Message-State: ALKqPwdjRP6o24l3oX7n4uhAE5uKKaJHXvr2HMFfo2tPZjMaFEBcm6jY Xcmer8AsCT+OyDSdAAQGkQVwITcB59GdCouFxiEUyOqIGHKZlc1JmnMefLnrk1J8k7+bnNVbBlc VIu6Wnqymb7fia2I4Kf5toQxJYFUkFPtHdL3KehBNFniuu4aowtm6W2DwgA7ymR+X+kLYQuCQf+ 6+HUnwDmj0ShCDmwOm06qVZLN34b9xUvYjX6EP7mEVpYQp5Uk5UcKbBMn3dTHDijOA7UWVB1iVf LVrQLabDpXp7pyTvB7UpSK8BCT1oRrtwgVG12wM2M+IH92YqYlsCpAOyt0IvhNbeElkyvV3gDgU DQAer9644twVpYLK/oBvgWgK9ZFNZLnSRFahbgrdoLeEfg3W6GwuV33kc3JT+u5nu7jt1JKMUUW I X-Received: by 2002:a65:4c4f:: with SMTP id l15-v6mr2959371pgr.61.1527094408036; Wed, 23 May 2018 09:53:28 -0700 (PDT) X-Received: by 2002:a65:4c4f:: with SMTP id l15-v6mr2959339pgr.61.1527094407126; Wed, 23 May 2018 09:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527094407; cv=none; d=google.com; s=arc-20160816; b=wRqXS6i2rw6wWsPgG6L57T/E8nLLEEF2TJFs13WEkYfVVVd5mpDLuelZ+NI6vBbBLN WsMAh//Cusw6HYpIVfgM6+XqReXNplQQfzlRAAdHW0ms+ASjGHzAzLohoqlR61pX7God 5krD1NZIu7oMJXgO/8Odv2ksEyaKjbRyNmvNU6jzU3U/OURmrVt5+DBkcT5BX9XIf9te DzmLXiOyzQtZVxOMYxefl6Dg7rzz4jiN+mXO3dgaa4HM7GAgbT+pq42XpTbkPBvFJsLe Dn7NQi8fqsWOyMZDZHQpgAUUsIFck6SGBZR+Di7Rp80qKWa7prwXZ+VIFgvE9SYRXiwi CqbQ== 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=8/t417FnqhBat11TkBfILMDFDjbYbPRlaltf7n39kN0=; b=LcD8Kx5/6isLe96cgcfV+Xzi+BGDb3x9fe49S0d2QpyIEx5G2RKyXbmY1X3DFWYNfh XLQ54mpCT5ooUOUivGkue3BeE2A/NPlvDCmsZJEfXWyRU+aMwtnalDcAxhrxKQYG/mQ6 fdfOSnMrhJerL5F+DQbzMDe7TL0bWi0HkeSGf9wcBvrELjqmBbm41cuMXaBnkWj8kpzA M/9he8dxqxnmegOIkLP1Lueo8nHz1GF8Tc75fXHM6eFwpVTYHLT1wEDHZRkrAQdlmOQf DtKVABgUw9E6TCrLByk6ZS2ETQmBX3DyhXL6Qh74tTkLw9svS7cnV4HaZFBS70d9dyaf tRwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sw42rYEp; 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 1-v6sor707915ply.75.2018.05.23.09.53.27 for (Google Transport Security); Wed, 23 May 2018 09:53:27 -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=Sw42rYEp; 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=8/t417FnqhBat11TkBfILMDFDjbYbPRlaltf7n39kN0=; b=Sw42rYEpJ9YKI0TLemBRZ3nhPCSxeCPAa42cpCSlq2MJhVZN4VqVWOyT1Mi5GNMLZ2 uFTlB+y8t33fMSIIOhBeqy/R2oMaOAtpU218IKq77qSHm/Bzv7wAHrc1J7WSqFfOkOWM ibaeCSflcwV4bPXdZ4trdBaX8z+Cu5sownV2TfU+3C0bheOunYQSnhSbQFCLQbwSHRTL CTQwCiW1wjsWRJjlZFjGb0Yx+npPrJEse2m+ayO9cwPky4eFWmS8kvTX1Z3BdX3dUTNX U269wKAMZgtKOl5BsUM1k5J4ArJZdy+No/6otGKSMWSNF8ShwPORbwW1JFm28YzxXNYw W/jQ== X-Google-Smtp-Source: AB8JxZpj13wqRsyMH+SmKjhJaoyKt2wh+pV7hIhQASHBj0UMxJjoKADM3spL4Z4h2M0Se7WHghBDnw== X-Received: by 2002:a17:902:2983:: with SMTP id h3-v6mr3756542plb.232.1527094406886; Wed, 23 May 2018 09:53:26 -0700 (PDT) Received: from localhost.localdomain ([123.120.56.60]) by smtp.gmail.com with ESMTPSA id c8-v6sm31740379pfi.96.2018.05.23.09.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 09:53:26 -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 , Konrad Rzeszutek Wilk , Boris Ostrovsky , Juergen Gross , Christoph Hellwig Subject: [RFC PATCH v3 3/9] drivers/xen/swiotlb-xen: update usage of zone modifiers Date: Thu, 24 May 2018 00:53:08 +0800 Message-Id: <1527094388-4383-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_DMA | __GFP_HIGHMEM). In function xen_swiotlb_alloc_coherent, it is obvious that __GFP_DMA32 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: Konrad Rzeszutek Wilk Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index e1c6089..3999959 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -301,7 +301,7 @@ int __ref xen_swiotlb_init(int verbose, bool early) * machine physical layout. We can't allocate highmem * because we can't return a pointer to it. */ - flags &= ~(__GFP_DMA | __GFP_HIGHMEM); + flags = GFP_NORMAL(flags); /* On ARM this function returns an ioremap'ped virtual address for * which virt_to_phys doesn't return the corresponding physical