From patchwork Mon Aug 9 08:23:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12425839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B51D4C4320A for ; Mon, 9 Aug 2021 08:23:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C7B0610FB for ; Mon, 9 Aug 2021 08:23:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C7B0610FB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 573C38D000B; Mon, 9 Aug 2021 04:23:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 525998D0003; Mon, 9 Aug 2021 04:23:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 439A18D000B; Mon, 9 Aug 2021 04:23:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id 283108D0003 for ; Mon, 9 Aug 2021 04:23:35 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D07631F87D for ; Mon, 9 Aug 2021 08:23:34 +0000 (UTC) X-FDA: 78454853148.04.6286085 Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) by imf28.hostedemail.com (Postfix) with ESMTP id 6F416900C52F for ; Mon, 9 Aug 2021 08:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Date:Message-ID:Subject :From; bh=rZYbYIu955Y7hbPYqYijgiSxa3DY4s64eyftIBXNDoQ=; b=A4J6Igvn/OmmYPUyuM9 0JxUZ0FQUQeoNPPC++M0k8ce6h5nvQaRwNkoUWYPNBx0YW9THcnNGkOJZ32XLBIqL1kPLV1JwGAO4 HJe1gLXVzpLYPHu7j+5OeFrDTRlMKYOz6OFbqHRAvleaANC+8uxKtfz1Asjz0go551YbplWhs9A=; Received: from [10.93.0.56] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1mD0ZG-006p7c-Ux; Mon, 09 Aug 2021 11:23:30 +0300 From: Vasily Averin Subject: [PATCH] mm: use in_task() in __gfp_pfmemalloc_flags() To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org Message-ID: Date: Mon, 9 Aug 2021 11:23:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Language: en-US Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=virtuozzo.com header.s=relay header.b=A4J6Igvn; dmarc=pass (policy=quarantine) header.from=virtuozzo.com; spf=pass (imf28.hostedemail.com: domain of vvs@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=vvs@virtuozzo.com X-Stat-Signature: 3d3djx4t9in64h8e884yuc47fh8jb6q9 X-Rspamd-Queue-Id: 6F416900C52F X-Rspamd-Server: rspam01 X-HE-Tag: 1628497414-344336 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: obsoleted in_interrupt() include task context with disabled BH, it's better to use in_task() instead. Signed-off-by: Vasily Averin --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 856b175..4291639 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4733,7 +4733,7 @@ static inline int __gfp_pfmemalloc_flags(gfp_t gfp_mask) return ALLOC_NO_WATERMARKS; if (in_serving_softirq() && (current->flags & PF_MEMALLOC)) return ALLOC_NO_WATERMARKS; - if (!in_interrupt()) { + if (in_task()) { if (current->flags & PF_MEMALLOC) return ALLOC_NO_WATERMARKS; else if (oom_reserves_allowed(current))