Message ID | 20230113111217.14134-3-mgorman@techsingularity.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp213414wrt; Fri, 13 Jan 2023 03:23:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXt3jQiXl0qk9WSFG7NSVVi6OobG18otqsA0MFuyY7cVzgZX4CKGXHqp2mDNrZOCVzO0+J/Q X-Received: by 2002:a05:6402:5245:b0:499:bcd7:a968 with SMTP id t5-20020a056402524500b00499bcd7a968mr17387620edd.22.1673609009986; Fri, 13 Jan 2023 03:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673609009; cv=none; d=google.com; s=arc-20160816; b=HXsRVxxWsduDZ930qocPDg1/FBGVxjHhUYEZvazKe59NARdhTe5lh74K2RuJjIRvFi g8S/K4+sXqDabsUK3a1GcjnXVK9TrLYAx0Eaky+CF9VaypH30WVrJkSgkmiSFZdqVLyg LLQAn7dwJ+QprlovAGMJI2T0dTMegIzIGOHcZac98a2PUdNuoDch3aEbu9ZslD/WawZj JMadwBrFy8oe39AV/Ry8L9oy02R1Rep5k1O2A7C5TT3la4tKSEtqgv0vWrukth49H6tc gm+7Y4QpW2kiEqa5ehzIGbRVhn7BmJDIESc2G8L9MLaeCV3ycFuYO2ft0sgcBUJhayyX xdwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FiHLbgT+/V2AjHkJD/pCH3t4rdxztdy//5LcZVO0gHM=; b=h9dMRoBPmC78spzedI9Ae+UaBJbfX6m5dg8ry2hWXq4VjYFkJPKBeOhMuffVI+KQUc idIZhJyV6wdNpIdlH4aJvLzN97/BuoXn5TLMYBNCmDDq+QwuLQ1SZrT/IYosr0o4vF3l HajJgc4th8hY7jkTmht3HYizI34T6SXI8s82kZvLfheT+mpYqSBM13J9DsHQbNR9Mvpy IRn4j6ZbAuWVV3+Km1GzVDXko+P2IUW/QyfRFed4vQlwjUYkiQrtQbh3xoAVKR+Ahjcf CSs9v22bsSbh8hpwrg4DF3fBCia15cfSs21f4Bplzm9A1V9NB2o5V/LMrgyeGmlhEmC8 hMlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p34-20020a056402502200b00488c68b1998si19843872eda.103.2023.01.13.03.23.02; Fri, 13 Jan 2023 03:23:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239679AbjAMLTA (ORCPT <rfc822;callmefire3@gmail.com> + 99 others); Fri, 13 Jan 2023 06:19:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241326AbjAMLR5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Jan 2023 06:17:57 -0500 Received: from outbound-smtp26.blacknight.com (outbound-smtp26.blacknight.com [81.17.249.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063CC7D9D5 for <linux-kernel@vger.kernel.org>; Fri, 13 Jan 2023 03:12:49 -0800 (PST) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp26.blacknight.com (Postfix) with ESMTPS id 8A53ECAE82 for <linux-kernel@vger.kernel.org>; Fri, 13 Jan 2023 11:12:48 +0000 (GMT) Received: (qmail 9303 invoked from network); 13 Jan 2023 11:12:48 -0000 Received: from unknown (HELO morpheus.112glenside.lan) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPA; 13 Jan 2023 11:12:48 -0000 From: Mel Gorman <mgorman@techsingularity.net> To: Andrew Morton <akpm@linux-foundation.org> Cc: Michal Hocko <mhocko@suse.com>, NeilBrown <neilb@suse.de>, Thierry Reding <thierry.reding@gmail.com>, Matthew Wilcox <willy@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Linux-MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>, Mel Gorman <mgorman@techsingularity.net> Subject: [PATCH 2/6] mm/page_alloc: Treat RT tasks similar to __GFP_HIGH Date: Fri, 13 Jan 2023 11:12:13 +0000 Message-Id: <20230113111217.14134-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230113111217.14134-1-mgorman@techsingularity.net> References: <20230113111217.14134-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754906241271732139?= X-GMAIL-MSGID: =?utf-8?q?1754906241271732139?= |
Series |
Discard __GFP_ATOMIC
|
|
Commit Message
Mel Gorman
Jan. 13, 2023, 11:12 a.m. UTC
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. Note that in a future kernel release that the RT special casing will be removed. Hard realtime tasks should be locking down resources in advance and ensuring enough memory is available. Even a soft-realtime task like audio or video live decoding which cannot jitter should be allocating both memory and any disk space required up-front before the recording starts instead of relying on reserves. At best, reserve access will only delay the problem by a very short interval. Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Michal Hocko <mhocko@suse.com> --- 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);