From patchwork Mon Aug 9 07:51:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12425811 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 13CF9C4338F for ; Mon, 9 Aug 2021 07:51:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7573A61056 for ; Mon, 9 Aug 2021 07:51:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7573A61056 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 8F22E8D0009; Mon, 9 Aug 2021 03:51:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A2988D0003; Mon, 9 Aug 2021 03:51:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B7DB8D0009; Mon, 9 Aug 2021 03:51:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 5FD8F8D0003 for ; Mon, 9 Aug 2021 03:51:52 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E8AC21EA0F for ; Mon, 9 Aug 2021 07:51:51 +0000 (UTC) X-FDA: 78454773222.28.73D8C6D Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) by imf04.hostedemail.com (Postfix) with ESMTP id 6AF22500AD9C for ; Mon, 9 Aug 2021 07:51:51 +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=mGHCmUBVtvGkrk3hZTW9nEpmEe7bL+y6TyOwWlgp52s=; b=Ef0RqscTUPW5j7jTgxS ucOGykVjk+DzLTmCGNBtEwO1q5DP3AoVEZUEILeZMOOdrmdHsq9SS3oPFOYDrTdtQFCpwRevYk/MG Lc/IwbemORjzNItaKJK3T4xC+T7n7IcNkOHjlP3BXPeGQ+xJKq2VWQkaVNPYb+N1qZQiqkeYUu4=; Received: from [10.93.0.56] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1mD04Y-006p2o-TJ; Mon, 09 Aug 2021 10:51:46 +0300 From: Vasily Averin Subject: [PATCH] mm: use in_task() in alloc_pages() To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org Message-ID: <96b9726a-4e43-bcf3-a27f-8fb7aa4a170b@virtuozzo.com> Date: Mon, 9 Aug 2021 10:51:45 +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: imf04.hostedemail.com; dkim=pass header.d=virtuozzo.com header.s=relay header.b=Ef0RqscT; dmarc=pass (policy=quarantine) header.from=virtuozzo.com; spf=pass (imf04.hostedemail.com: domain of vvs@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=vvs@virtuozzo.com X-Stat-Signature: 6nqjzzr4n33ri7wan9ppzy1b6b7u953e X-Rspamd-Queue-Id: 6AF22500AD9C X-Rspamd-Server: rspam01 X-HE-Tag: 1628495511-120200 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() includes task context with enabled BH, it's better to use in_task() instead. Signed-off-by: Vasily Averin --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e32360e..2f8ee67 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2231,7 +2231,7 @@ struct page *alloc_pages(gfp_t gfp, unsigned order) struct mempolicy *pol = &default_policy; struct page *page; - if (!in_interrupt() && !(gfp & __GFP_THISNODE)) + if (in_task() && !(gfp & __GFP_THISNODE)) pol = get_task_policy(current); /*