From patchwork Mon Jan 9 15:16:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 13093709 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 A6B61C5479D for ; Mon, 9 Jan 2023 15:17:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 406828E000A; Mon, 9 Jan 2023 10:17:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B6D88E0001; Mon, 9 Jan 2023 10:17:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A6498E000A; Mon, 9 Jan 2023 10:17:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1CDCB8E0001 for ; Mon, 9 Jan 2023 10:17:10 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D3596AAE20 for ; Mon, 9 Jan 2023 15:17:09 +0000 (UTC) X-FDA: 80335613778.19.7764EBC Received: from outbound-smtp10.blacknight.com (outbound-smtp10.blacknight.com [46.22.139.15]) by imf05.hostedemail.com (Postfix) with ESMTP id 2A27E100006 for ; Mon, 9 Jan 2023 15:17:07 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673277428; 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=wNNO3WG+hYMDAnexlcyOoQNVFKpjqk833XO89T5ImN0=; b=E8C8suuy0MFiHTadvxsgBRCOuenFMZaPll6yEndmZx1suJNjIM3jCjOfPGpVSXyAJUMpZz I4YzMXdFN955aq5BsCJmwLj5PQZvd2ZZXRx3Ng86phXFKtk5+YhxLop2hi0SL+zU9yrobt Jtai7D839TNpE7lI0FYYliM8XYtWx2U= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.15 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673277428; a=rsa-sha256; cv=none; b=8UUuhAAMzZPXv1PRT5Op3HrK1AQhktNQ9bs5jqcqk5+ZTy68rbPlUMRxHqT4ry2y+9QNfF BpWmLs15mUkvfDf3DoAShle6894iOF0kUW8vg47Lji+NcQFUQZyTm8+s9Hv6Ttn1TJqPaa F3G+96CYGnXOhCkbLlPUCsgRuzSYOoM= Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp10.blacknight.com (Postfix) with ESMTPS id 1397D1C40F8 for ; Mon, 9 Jan 2023 15:17:05 +0000 (GMT) Received: (qmail 17223 invoked from network); 9 Jan 2023 15:17:04 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPA; 9 Jan 2023 15:17:04 -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/7] mm/page_alloc: Treat RT tasks similar to __GFP_HIGH Date: Mon, 9 Jan 2023 15:16:26 +0000 Message-Id: <20230109151631.24923-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230109151631.24923-1-mgorman@techsingularity.net> References: <20230109151631.24923-1-mgorman@techsingularity.net> MIME-Version: 1.0 X-Stat-Signature: oa4hux4mtnqcxp7i5cidbkuutrs4uzm6 X-Rspam-User: X-Rspamd-Queue-Id: 2A27E100006 X-Rspamd-Server: rspam06 X-HE-Tag: 1673277427-849466 X-HE-Meta: U2FsdGVkX1/KAMiQX8Z4aT3KC6T1SKaPu5YrO3Br8xnoF1MZfGa+dOpYKRKgtlu04mbpNG6SLADtv3EJolRHlXtbPFIsKJLTUXzvgqOpmSnr3/ml0VaLXZ5E9PrYe3lzvAzNkepxKdro9tHns5Fa7bwtpkdnk+7mxVslNn4JAt7Bdj6SMJnyOU7EWXLJYrr24h+EIgNINg2lJZeS94VsxrwocHidLOtMr3m77UgZgeO391bVHCScuqXxd+3Hs+Ozmf5Gb4obiR52oLLN1IwoZPHVufwvixX25rP6M+HG7KFQnqszh7kTVlhRrpv3u+ksLyVY6/mY/0Bm/++i74eKY/dsir7sngT573uaWoc/9sLvUni8zcYuAcOhoPaLT42oiI6hu3pQhH1etdbH+S8sflc5gSMRmW1YTYFNC/0VkqchC4KJBLWWeG6KJcVLRJHThhHKr18USSC9OqV8DwV8rOB9KraqfFgLwQcIQUQLm77nTKU3xTqCzsvPx/EI3RlO5Pw6azRdLltJG8o+yBYrOsdTnEnoDHNjj/bZCn55JNFlHv0NqO72jsOze07j0Or0yNRdTXwtMcMzPyN9kYG70n8qYTsu5/VRYovDMFg05Kukn8lpxXARU2T2gu7ZwZRthCdlluFqolISlrKks/dJhgwsywdJC2py3J/PhpiJFqnx9TPGkM3nX15JptsWztZZ0YfYKYHtcgbKX3Feew0tOn6OnXe83w6Qhk3tYrfVYSEX29bGf5mNUN7/zEOOvSOlvtsS1TPOixsSUVE8rSNnU6F53VJCKgGOe52HaU8Sb5esu1ZAGwtgz5rH2jKbrp7xIV2jqUcMgc/j18RHZWAeWpBgihxL8Ia1dxBpWZh7PRdP8pZ0coU8M4+cDlfXeEZVxX2kSRA0L8Hl5R8lf+m88Qa4GVgkaaCiwoK0yt8pT+BcI0dC0mgJbeRv/EFb7J2kg5X1NWYCqQ4/5a7BT+E kndsqOZ0 AA/eTRH62dcCS3lDdymKXV879loNXmyESXTcqgYsvUFl9xch2QXa+NrtQ9+KFLhvBMlSE 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 Acked-by: Michal Hocko --- 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 244c1e675dc8..0040b4e00913 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4847,7 +4847,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);