Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2753513pxk; Tue, 15 Sep 2020 01:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMiE5KGdkpneO3qFhOYoDkqLjrCJH7vuYf6rt8hEQz4ouzRUfh6cjuEReyXs3xJhCxbasJ X-Received: by 2002:aa7:c6cf:: with SMTP id b15mr7837028eds.134.1600157115657; Tue, 15 Sep 2020 01:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600157115; cv=none; d=google.com; s=arc-20160816; b=1GEZw7oGuyt4u0Ah3OwaQHhtj42ZEffibRo2Ox+r84FSp+CtAkGepVTI7i6SnbiibT wPsu6mA5fwnC15IBy6yBXiZG6bL41HwImkW41G6U9kKTgM5K/JtfyQAd5uM7baKhPKcJ RGeYrY0EtYtQ0U0bYNcLCyJfYj79zzFxbrdWIxZP9BRsNR8iIqxpbQ6eZzcWTyTW0FXg pxJEr6rp+5Cp9JAUE6Drs6fqap91GEF0NI81nZSDSduLU3YKqJ8rMb3FnM2b2Afhf3nu GcYuom2ENZw+u5cA5TvzuvdLrH0wAXCOoakLeJXCATCQmEptwo1tQXhpW9BguwAqRnAb RhAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ye4A82zlekkvm9zt1le6Rn8ku4q/6QYEKT81w7moHEw=; b=qlqxtNFZtlEL+B7k3bJcha5jX1aoNUaTEP9FsTQEZdXu61doi7Okp0rjPmKn/KfEna xizth563xpzu5v0VUZ8MkJxa+eH7hzefoElDHmA3PLaHfG1/aZvoXxsegjP8pugBEzdl e/1N12uFMO/Oc400pYYjVHQ4MMbEVgeqkGapBkpmGMJYwuBXH2lpe+bvdQb4Mk3S2qeL n3kKL+H3OKrd0pqEQ96Cx7qUhm8dBbY8yqbvVfOTESrqNS2v8eKT6yuhANXWeXVvVqCm PpL4yjX19+UNeLlXOik9Ao1pE5wiHvoiOMTHksuCZXFT1Tzb2v3zVzBS5vyOcRF+cY1i YZGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si9099197edr.259.2020.09.15.01.04.53; Tue, 15 Sep 2020 01:05:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbgIOH7h (ORCPT + 99 others); Tue, 15 Sep 2020 03:59:37 -0400 Received: from mail1.windriver.com ([147.11.146.13]:41793 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgIOH5P (ORCPT ); Tue, 15 Sep 2020 03:57:15 -0400 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; /* -- 2.18.2