From patchwork Mon May 21 15:20:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10415607 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 0684360365 for ; Mon, 21 May 2018 15:21:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA20128A96 for ; Mon, 21 May 2018 15:21:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5F9B28AF5; Mon, 21 May 2018 15:21: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 E6E3428B1D for ; Mon, 21 May 2018 15:20:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09A7D6B0007; Mon, 21 May 2018 11:20:54 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0213A6B0008; Mon, 21 May 2018 11:20:53 -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 E04E36B000A; Mon, 21 May 2018 11:20:53 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id 968756B0007 for ; Mon, 21 May 2018 11:20:53 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id a14-v6so10207879plt.7 for ; Mon, 21 May 2018 08:20:53 -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=Pzs2NzeRlCb9X0ibpkf1mD9br6NpgeDf+l77IWkXvG4=; b=T9xsery2R8dsJd2QuBuyRPmwLyqStJ5xlccsev8MkqF8YWhumK3RTSwgksXeCG8+bQ 68qibSm0Ya1DLorcg6zUTrYDW0QN+wK8tCgs+fRfz1LMvb/sn3FsTVOZCWb1nOZku+Q4 mxiR6QKX/n6z+rDVtuNlCCAlw2HK/4oRHJTQeEDoqpi0YdQ0Dqbp7E3449uWWquygzyC J57kWUCFxodz9SFs0FAE1MxMBGP0q1puNu5DeaZ37IQGUtQgAKAEx3Jtt1a9icrjssH6 RPEf++mJjX8WmmO/fUXMdhn5jJBtmcbxN/2t1Qd12nKFXd1rha5tW8YT6OzLASQVpvC5 WcMA== X-Gm-Message-State: ALKqPwenf6Y/4Q61GGfx1XDdPM50tmDrzjDU0vN/aPXUS3pZYKgcUr9B S1b5aCtKR5BZRC1RB+th/5MTkQM97MmrrCj04f/CS4ye0W85QG98SHhqg6CKgNfqNx6PVRg1aj5 aywHR7gKP9876A3nt+PpjV/22cYRQpU00fzr5zB9Sj5kU1YFKsQhoqzgnl6jXz3EXAcS2F3RnHO HbOe1/0qhgboe36khnQRvAjLjTb/sVuhfeozeGdXDw8WZkdGPB3yjnRAtm5su6XJ53Y28cwtVGJ VVvBqS5aI3CSPH+y9OD6YgQ9AaApV4OeUk+ejBNlWCv81oBby5LXQQxaZlC2cITbKRgnYUMvH/z dPTlWcjUj6tcqUDJIa3PslQgWdR2mDN69UVg+6dm7ek7oLx+xOfF/sZBpV45ITRCMCj+ajuEMHH s X-Received: by 2002:a17:902:6e4:: with SMTP id 91-v6mr20750617plh.63.1526916053301; Mon, 21 May 2018 08:20:53 -0700 (PDT) X-Received: by 2002:a17:902:6e4:: with SMTP id 91-v6mr20750582plh.63.1526916052642; Mon, 21 May 2018 08:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526916052; cv=none; d=google.com; s=arc-20160816; b=SG4Nwu0N29rFV2YsiB8NpKPitozxN2UVQA8oAVT8vAnYSZLb2LTe97xcrWofDz72CJ OWkRfwo8OlqvjCzEqgxcLVqIP/8lu2edVCn7jpB5b62iqvaAXjOOK45t/b6iiUavszWG Vfq100IuNIiwzKykCDopZz1btIjgxGCikDlEhSeGHXP6Na8R4ltZEoWjEXtXL/XYcL3B G5MlRSP0zJvfuBZkyF3DOeMIVyYX2GW2fypyMmFOTkGyKP5hNbLfVPcd/W4o9Kxu0UiM 3qzwFa/AgqQOeuLV4/FKZQyqwuTiOPC7zEgGIcCKF17mej7dyeEE5jDetVu5VG3g0xTF LJbw== 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=Pzs2NzeRlCb9X0ibpkf1mD9br6NpgeDf+l77IWkXvG4=; b=wcpQ8+jDgkX2djt6v1vz/jxlOXpWYlXSKi8/Yj1ho0/Qt6EUdutUv7PK1ITxc0YAfD 4+ndjL8bvIE6f8VBOhxhheKEqd8qMIAFEdSOsYz+QlNLyqXVRtx9dca9ySpx896OU3/E wbayNW6Gs2lIlOHSFVWuGMB2CjC/7ovDZrAIe42mVRkdofNFg2/6zAsWpvOdCx/SQQME 3GSEDlwbFkFePv7WbnxEg6KzZSEeV1XQqkkTN9/Df4HQRcWjgusilhT4A98+XkgKeKAY S/nkzpSgRNVFrAGjO3bbRKvp2xZcOmxdt391ZY6d7DK5a2ppm0NbNkUIwug5DpIGwm4L H/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MQn9gBEE; 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 q26-v6sor5348421pfh.87.2018.05.21.08.20.52 for (Google Transport Security); Mon, 21 May 2018 08:20:52 -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=MQn9gBEE; 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=Pzs2NzeRlCb9X0ibpkf1mD9br6NpgeDf+l77IWkXvG4=; b=MQn9gBEEKlMaQTxFIFXtIZ2+3VBdkOLwQZEyXAG6R41ubbvilX5ymvukwKvS5MQV7q SX45CgyCRftcMnQKa6B92YeK4zeP6v4LQnuuE848/OkEbO/+oWXNl3dpBVobxZK6bWk1 Qb15NBjNEHcSAC33geSQK5nvsArjz1Zk5QAKLULKmkaHInEnWQb2wmgR7dpv73IbjySP tNn3veAlc4OtF7M383SYn7GTSpDgAfshc5gndQJ+rxUCStgHJT3diLvRenp3O3nxBuPQ 7RwQJxSevOHm4gWVYSrkaY90lfSDVdQyKWL5EFKe9vKk+peTL5mpIO8wu7SFuOAEJg/l DBlA== X-Google-Smtp-Source: AB8JxZpVAZvz1PxSltGd4psCJG6EaEMmfGQJ8l1ZcUvd3x7p2B1fVx0jLNS83Fs1Zb7VVDFEkaIUVw== X-Received: by 2002:a62:4916:: with SMTP id w22-v6mr20359735pfa.63.1526916052338; Mon, 21 May 2018 08:20:52 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 08:20:51 -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 , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Robin Murphy Subject: [RFC PATCH v2 02/12] arch/x86/kernel/amd_gart_64: update usage of address zone modifiers Date: Mon, 21 May 2018 23:20:23 +0800 Message-Id: <1526916033-4877-3-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: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Robin Murphy --- arch/x86/kernel/amd_gart_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index ecd486c..1dd6971 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -485,7 +485,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, struct page *page; if (force_iommu && !(flag & GFP_DMA)) { - flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); + flag &= ~__GFP_ZONE_MASK; page = alloc_pages(flag | __GFP_ZERO, get_order(size)); if (!page) return NULL;