From patchwork Mon Aug 9 10:46:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12426221 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 EB09DC432BE for ; Mon, 9 Aug 2021 10:46:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5705960C40 for ; Mon, 9 Aug 2021 10:46:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5705960C40 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 9DB526B0071; Mon, 9 Aug 2021 06:46:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98A7B6B0073; Mon, 9 Aug 2021 06:46:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87A566B0074; Mon, 9 Aug 2021 06:46:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 6ECF96B0071 for ; Mon, 9 Aug 2021 06:46:53 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 226BF181CBDAD for ; Mon, 9 Aug 2021 10:46:53 +0000 (UTC) X-FDA: 78455214306.09.C45BEFC Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) by imf13.hostedemail.com (Postfix) with ESMTP id 9E19A100ADA9 for ; Mon, 9 Aug 2021 10:46:52 +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=9YHMSCcvf9S1i8/cpiMhGW46gXxYh7k5FxFkcCgAo6E=; b=TZGF07Ye995jmwdzogI Dc9u3AYK4ndcJV2wQnVwlG5LE4WKIlXs7qHa23YQFs6fNMtrcoaF7pdRcChLThEFbgCPX9i/hroLm LZs+a3iW5tTYxjLyOy/obbQ/NCNZ8iG9vtsWMTn+ZpUaS/HY/iBJXYHgYCMuNFoO7h5XTVjvCdc=; Received: from [10.93.0.56] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1mD2nx-006q1A-Ji; Mon, 09 Aug 2021 13:46:49 +0300 From: Vasily Averin Subject: [PATCH] mm: use in_task in mm/page_alloc.c To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org Message-ID: <877caa99-1994-5545-92d2-d0bb2e394182@virtuozzo.com> Date: Mon, 9 Aug 2021 13:46:49 +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 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9E19A100ADA9 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=virtuozzo.com header.s=relay header.b=TZGF07Ye; dmarc=pass (policy=quarantine) header.from=virtuozzo.com; spf=pass (imf13.hostedemail.com: domain of vvs@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=vvs@virtuozzo.com X-Stat-Signature: xh33o1jty94cos77ici8wfhi8x6z1yjg X-HE-Tag: 1628506012-315579 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_intrrupt() include task context with disabled BH, it's better to use in_task() instead. Signed-off-by: Vasily Averin --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4291639..a385194 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4212,7 +4212,7 @@ static void warn_alloc_show_mem(gfp_t gfp_mask, nodemask_t *nodemask) if (tsk_is_oom_victim(current) || (current->flags & (PF_MEMALLOC | PF_EXITING))) filter &= ~SHOW_MEM_FILTER_NODES; - if (in_interrupt() || !(gfp_mask & __GFP_DIRECT_RECLAIM)) + if (!in_task() || !(gfp_mask & __GFP_DIRECT_RECLAIM)) filter &= ~SHOW_MEM_FILTER_NODES; show_mem(filter, nodemask); @@ -4698,7 +4698,7 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, * comment for __cpuset_node_allowed(). */ alloc_flags &= ~ALLOC_CPUSET; - } else if (unlikely(rt_task(current)) && !in_interrupt()) + } else if (unlikely(rt_task(current)) && in_task()) alloc_flags |= ALLOC_HARDER; alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, alloc_flags); @@ -5158,7 +5158,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, * When we are in the interrupt context, it is irrelevant * to the current task context. It means that any node ok. */ - if (!in_interrupt() && !ac->nodemask) + if (in_task() && !ac->nodemask) ac->nodemask = &cpuset_current_mems_allowed; else *alloc_flags |= ALLOC_CPUSET;