From patchwork Tue Sep 15 07:56:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Yanfei" X-Patchwork-Id: 11775809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A145618 for ; Tue, 15 Sep 2020 07:56:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 30CD221D43 for ; Tue, 15 Sep 2020 07:56:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30CD221D43 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44D3A90002B; Tue, 15 Sep 2020 03:56:49 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3FDA690001D; Tue, 15 Sep 2020 03:56:49 -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 3133490002B; Tue, 15 Sep 2020 03:56:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 1BEF890001D for ; Tue, 15 Sep 2020 03:56:49 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D7E1A8249980 for ; Tue, 15 Sep 2020 07:56:48 +0000 (UTC) X-FDA: 77264539296.20.rub32_5803f3a2710f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 99CDD180C07A3 for ; Tue, 15 Sep 2020 07:56:48 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,yanfei.xu@windriver.com,,RULES_HIT:30054:30069,0,RBL:147.11.146.13:@windriver.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10;04yfc5qxfmfmcfi8iy4up53145racop1pomccsopcs9fci5ujca7w9ot8ch9kh6.fwiebueeci1sbsynxegrqpopiq8wy9ci3wah7aj8fna5mmo7dkouw1ng3cksrrp.q-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: rub32_5803f3a2710f X-Filterd-Recvd-Size: 1827 Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Sep 2020 07:56:47 +0000 (UTC) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 08F7uiJU022562 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 15 Sep 2020 00:56:44 -0700 (PDT) Received: from pek-lpggp1.wrs.com (128.224.153.74) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 00:56:36 -0700 From: To: CC: , Subject: [PATCH] mm/page_alloc.c: avoid inheritting current's flags when invoked in interrupt Date: Tue, 15 Sep 2020 15:56:35 +0800 Message-ID: <20200915075635.1112-1-yanfei.xu@windriver.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 99CDD180C07A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: From: Yanfei Xu alloc_mask shouldn't inherit the current task's flags when __alloc_pages_nodemask is invoked in interrupt. Signed-off-by: Yanfei Xu --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fab5e97dc9ca..388b587b35a8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4889,7 +4889,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid, * from a particular context which has been marked by * memalloc_no{fs,io}_{save,restore}. */ - alloc_mask = current_gfp_context(gfp_mask); + if (!in_interrupt()) + alloc_mask = current_gfp_context(gfp_mask); ac.spread_dirty_pages = false; /*