From mboxrd@z Thu Jan 1 00:00:00 1970 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 C8C0AC4167B for ; Tue, 14 Nov 2023 10:48:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 977116B02A3; Tue, 14 Nov 2023 05:48:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9249C6B02B0; Tue, 14 Nov 2023 05:48:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 813C66B02B5; Tue, 14 Nov 2023 05:48:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 72FF86B02A3 for ; Tue, 14 Nov 2023 05:48:27 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4DD84140A16 for ; Tue, 14 Nov 2023 10:48:27 +0000 (UTC) X-FDA: 81456235854.26.7715C62 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf07.hostedemail.com (Postfix) with ESMTP id 4BC6640006 for ; Tue, 14 Nov 2023 10:48:25 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JU5lArdP; spf=pass (imf07.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699958905; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BrjlFQJPB430Xww/Nj/QXjsT479LtYaL6hPDX+DNKB8=; b=phGoOt/DwlrKsGQZANSDJMKlwwYhFrQ4xuKSYeZmcN1uEbZE+zhld6m6o6T6cpF4acDYR9 Xm3l6hrkkj/N4jFnqiJ+CQi2w+okLe32meyZD7zNJ8d5UQA2NGGKIGdzLpOkhQueXr49Yn RDl7T0UNtrfSKrVppyf4V+ZI1qGRPXM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JU5lArdP; spf=pass (imf07.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699958905; a=rsa-sha256; cv=none; b=wbNEQsST0XKfYdzGsOQnegDXgC6QAkH2PKpXrfAI9A/T5oGzLnGu4zrqr0fcQxXEbUnmiL +yD1TAIjodvsIaJsGKZDqBPC489IY8K3zXgGhvHeyKQ8DFHdm+d2e+v3AMYEvsJ6b3GNS3 hkVJNXAM9+XYNXItx/R1GQmcFMOmzro= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8AF341F86A; Tue, 14 Nov 2023 10:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1699958902; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BrjlFQJPB430Xww/Nj/QXjsT479LtYaL6hPDX+DNKB8=; b=JU5lArdPfGDm1DJ0lLlBDaFe4KTYtNY9VHXm9Kaug+gC/56aa9A1dVvwPPk+nhO8OkfSjQ S4CBlurK4XNTVsJ8ugJTPfcvHPx8vtwK5Y5ehIPfyEO0gVD2J3t/BTef+rLN3KWeWg7fwr Z3TelnIsPf2HVChfLPNxFv9K7xlrPj8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 62C6C13460; Tue, 14 Nov 2023 10:48:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gpsLFXZQU2W2OQAAMHmgww (envelope-from ); Tue, 14 Nov 2023 10:48:22 +0000 Date: Tue, 14 Nov 2023 11:48:21 +0100 From: Michal Hocko To: Charan Teja Kalla Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, david@redhat.com, vbabka@suse.cz, hannes@cmpxchg.org, quic_pkondeti@quicinc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 3/3] mm: page_alloc: drain pcp lists before oom kill Message-ID: References: <5c7f25f9-f86b-8e15-8603-e212b9911cac@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c7f25f9-f86b-8e15-8603-e212b9911cac@quicinc.com> X-Rspamd-Queue-Id: 4BC6640006 X-Rspam-User: X-Stat-Signature: 7q1ryiadmxxkuicmfjo9kjrkgzqcp1ii X-Rspamd-Server: rspam01 X-HE-Tag: 1699958905-366010 X-HE-Meta: U2FsdGVkX19p98LH9NHjLjv6VrjtppCq349Ii8xHnEAuMQwf+cvnrRipWhQLXGBz+qCtqr3LHfadYkrrEA2jpbfHGigcfW9+7OFEALUmTuGefylTSF7OP/QDOsdR6hxiwBdIlRRvfVs7QMvDOjLDXx/kSjLzd0aGyRFGQv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bogofilter, spamicity=0.000009, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri 10-11-23 22:06:22, Charan Teja Kalla wrote: > Thanks Michal!! > > On 11/9/2023 4:03 PM, Michal Hocko wrote: > >> VM system running with ~50MB of memory shown the below stats during OOM > >> kill: > >> Normal free:760kB boost:0kB min:768kB low:960kB high:1152kB > >> reserved_highatomic:0KB managed:49152kB free_pcp:460kB > >> > >> Though in such system state OOM kill is imminent, but the current kill > >> could have been delayed if the pcp is drained as pcp + free is even > >> above the high watermark. > > TBH I am not sure this is really worth it. Does it really reduce the > > risk of the OOM in any practical situation? > > At least in my particular stress test case it just delayed the OOM as i > can see that at the time of OOM kill, there are no free pcp pages. My > understanding of the OOM is that it should be the last resort and only > after doing the enough reclaim retries. CMIW here. Yes it is a last resort but it is a heuristic as well. So the real questoin is whether this makes any practical difference outside of artificial workloads. I do not see anything particularly worrying to drain the pcp cache but it should be noted that this won't be 100% either as racing freeing of memory will end up on pcp lists first. -- Michal Hocko SUSE Labs