From patchwork Tue Nov 29 15:16:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13058709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EF97C433FE for ; Tue, 29 Nov 2022 15:17:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3D356B0074; Tue, 29 Nov 2022 10:17:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DEDCB6B0075; Tue, 29 Nov 2022 10:17:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDC696B0078; Tue, 29 Nov 2022 10:17:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BEED56B0074 for ; Tue, 29 Nov 2022 10:17:36 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 92615C1033 for ; Tue, 29 Nov 2022 15:17:36 +0000 (UTC) X-FDA: 80186834112.02.9E87C44 Received: from outbound-smtp37.blacknight.com (outbound-smtp37.blacknight.com [46.22.139.220]) by imf15.hostedemail.com (Postfix) with ESMTP id F352AA0012 for ; Tue, 29 Nov 2022 15:17:35 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id 327DA1C61 for ; Tue, 29 Nov 2022 15:17:34 +0000 (GMT) Received: (qmail 4272 invoked from network); 29 Nov 2022 15:17:34 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPA; 29 Nov 2022 15:17:33 -0000 From: Mel Gorman To: Linux-MM Cc: Andrew Morton , Michal Hocko , NeilBrown , Thierry Reding , Matthew Wilcox , Vlastimil Babka , LKML , Mel Gorman Subject: [PATCH 2/6] mm/page_alloc: Treat RT tasks similar to GFP_HIGH Date: Tue, 29 Nov 2022 15:16:57 +0000 Message-Id: <20221129151701.23261-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221129151701.23261-1-mgorman@techsingularity.net> References: <20221129151701.23261-1-mgorman@techsingularity.net> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.220 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669735056; a=rsa-sha256; cv=none; b=Ga250qUNBZelJUVMJxKgfUSkLSdv6x4YUMuffe92HGOHw+GhsQwsQ4cMQcLouftjD7eIHJ 5Op3H94R5C99QNr5lEBtMLGM9mZHE7Wjae8xAE+Nmpscz7KGxXdwOWIn+d3qc/kFODAph2 86/cOpdO1g36UQCc5IBYxXST2P2LtyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669735056; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RloEp3DcyqsMnLvnLDoePVyl3xCkiZ6l2wnKdsZO1Gw=; b=365PpV3hrDRuU115NNwsz+KxzjgX6q/5CSLBU19YrjdKWoeM4VhO6pdSJ+cuApGtaQMw2n XM72CTG1LotztM85WxnpT8yRWtIupWZ2q23/3rsPxgWIcFGNqCN/BWV+Vyp42bamCu61dQ 9nMmznLYhdKIcuZ3LmILb50yuFDl5TQ= Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf15.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.220 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam01 X-Stat-Signature: gmga6j63znb6hro1dtho5eh5z4oha3pk X-Rspamd-Queue-Id: F352AA0012 X-Rspam-User: X-HE-Tag: 1669735055-974498 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: RT tasks are allowed to dip below the min reserve but ALLOC_HARDER is typically combined with ALLOC_MIN_RESERVE so RT tasks are a little unusual. While there is some justification for allowing RT tasks access to memory reserves, there is a strong chance that a RT task that is also under memory pressure is at risk of missing deadlines anyway. Relax how much reserves an RT task can access by treating it the same as __GFP_HIGH allocations. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- 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 3b37909617bc..da746e9eb2cf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4852,7 +4852,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask) */ alloc_flags &= ~ALLOC_CPUSET; } else if (unlikely(rt_task(current)) && in_task()) - alloc_flags |= ALLOC_HARDER; + alloc_flags |= ALLOC_MIN_RESERVE; alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, alloc_flags);