Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1875398rdb; Tue, 20 Feb 2024 09:26:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXBNeCmsL4vwTC+QXy7pjpZSIPeDneLmYmgCLIoKh0X9OnOhXMEyMjZ6cYkk5eD3csViHWYLWxC18XbRHC7CAHdySHO+7M76bW5vYxS3A== X-Google-Smtp-Source: AGHT+IFfS3ft5JLyuJFKJUVIoaP/lDLHMTQq2qLjGE0DmOzO0OBBjeOYkGm9E+fpX0t6PXM4QZ5Q X-Received: by 2002:a05:6a21:3115:b0:1a0:6016:bf90 with SMTP id yz21-20020a056a21311500b001a06016bf90mr14984635pzb.47.1708449961332; Tue, 20 Feb 2024 09:26:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708449961; cv=pass; d=google.com; s=arc-20160816; b=lTWUAkCkjNXISfGM8vUJtuD8uYSOaafkODrWcBwfL/59wSNaPL/xlw4cEuQ44j9yrJ RZSSaXSqS8X3XJ40oo31clexgHWyyq04Ta+Yb5SWgwTRsh8yEQw3FiZw+U3059vpZ5w3 icjXZe1uiNpqxLhk7Jmcs1n35eG1HNLEuOVrjs3QxIYGH20geAfKWDfad+DbQ9qC3gjm mXJ8iZbgeZF9QhAEVRL/RyPWPbmvpksJ7PKNdIlDL3NYA9v+Ynx2+J7C4t4+Wa3v/GBp x+UVft39pUq0lNN9la0qu7P0TGRoi0OC0wHRwAUk7itqbxh1ZE+ywYtOhqaq5qXqAWBY 0S9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=t4AkBXTli0JY+7cZt6wPmw2DkCGDriEpGC9jORxnoKQ=; fh=upQfiW1Lc4n50NXZQ7czm1Dy08GufKWRdtonyBmXd9M=; b=m/9E/rkiBwkiU6EdDtjPWFNRS3JOpgYnCh5ipgB9hKAltWfe2lkZ1Z+katjv4jDleM 3R/o4O150/xm5AuJTdGXQRAKELiIeK3hRdJ1zfgwVOFNl4ZafKaSrRCHWMVAO1n+5GUv 79l7NAc9YBwSe1dn9nT5CRMTZSfTPAJcP0VToI2sqx6WHIAvhdfrnoannuRaLSUZ+Wnf Qaomkmdebxe/UGz2o1MvAXTGjRtsKELXiufCcKffQQ/94oNyc2duSoidOJY0OBZqW8fB kOMmw7TMWgpP14ScHSV0EAGlg2DND/OAsakQytaBCwIP5ygDwocAJWYyWQ4eUp/0twAT BykQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="aQPLcI4/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="aQPLcI4/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-73437-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g69-20020a636b48000000b005dc4d954a84si6449672pgc.226.2024.02.20.09.26.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:26:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73437-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="aQPLcI4/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="aQPLcI4/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-73437-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 57E1F28756B for ; Tue, 20 Feb 2024 17:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4492177F2F; Tue, 20 Feb 2024 17:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="aQPLcI4/"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="aQPLcI4/" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B1E976C82; Tue, 20 Feb 2024 17:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449890; cv=none; b=Il2W840uKasOt0PHrDDttI672612nuxmKIrhYRmmnhHIbHUf3pQEqgIJYwf1jSh3o91LZD3qJ/45IooyMXz1kEiWObJ9qwBfEg57iMIPq3PfpcAKpCi+yoZIdm3wkvqMMOCVYx8ddagNJb0LFp6O80+hKbcoMawKezR0uPTPB3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449890; c=relaxed/simple; bh=DYjAtTcdrA+3yesjLjiOa6zarg7f3lq4MltEqsSmWOY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d1RnTKwei0iOn9c4NrPwy6ba6aROFBSrJVRIVHClybyvesuLQHTMxUIHjmr6YcqZSA1BhELpJTjYCjxcEh4TpkatRSgVzmdR4TcsyU5QntN987UTZVQYf7P2xf6pXaTM8Gfmg816So72EmSSBERyBaQJJ6wtAzDDWsEKSMHM47E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=aQPLcI4/; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=aQPLcI4/; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A8C5B1F8B8; Tue, 20 Feb 2024 17:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708449886; 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=t4AkBXTli0JY+7cZt6wPmw2DkCGDriEpGC9jORxnoKQ=; b=aQPLcI4/9mO6h+uCLy+F3vNbFo6yXpPd/kXfM+5ZnJNsPgONEm+fGYam9wlNYQvJimo99P +SAr8KwfOoVjHcH0ALF1D1eYEDiZ9wAyVZwxfrVBPLbxVh+WaqgnBEfqD0DDgVJrYF6lMD BFjx8NjxiaAUF0F1u10keYk1Bn26A3E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708449886; 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=t4AkBXTli0JY+7cZt6wPmw2DkCGDriEpGC9jORxnoKQ=; b=aQPLcI4/9mO6h+uCLy+F3vNbFo6yXpPd/kXfM+5ZnJNsPgONEm+fGYam9wlNYQvJimo99P +SAr8KwfOoVjHcH0ALF1D1eYEDiZ9wAyVZwxfrVBPLbxVh+WaqgnBEfqD0DDgVJrYF6lMD BFjx8NjxiaAUF0F1u10keYk1Bn26A3E= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7A510134E4; Tue, 20 Feb 2024 17:24:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id A2RRHV7g1GXZYwAAD6G6ig (envelope-from ); Tue, 20 Feb 2024 17:24:46 +0000 Date: Tue, 20 Feb 2024 18:24:41 +0100 From: Michal Hocko To: Kent Overstreet Cc: Suren Baghdasaryan , Steven Rostedt , Vlastimil Babka , akpm@linux-foundation.org, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Subject: Re: [PATCH v3 31/35] lib: add memory allocations report in show_mem() Message-ID: References: <320cd134-b767-4f29-869b-d219793ba8a1@suse.cz> <20240215180742.34470209@gandalf.local.home> <20240215181648.67170ed5@gandalf.local.home> <20240215182729.659f3f1c@gandalf.local.home> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [1.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.00)[14.10%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_GT_50(0.00)[73]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[google.com,goodmis.org,suse.cz,linux-foundation.org,cmpxchg.org,linux.dev,suse.de,stgolabs.net,infradead.org,oracle.com,lwn.net,manifault.com,redhat.com,arm.com,kernel.org,arndb.de,linutronix.de,linux.intel.com,kernel.dk,soleen.com,gmail.com,chromium.org,linuxfoundation.org,linaro.org,linux.com,lge.com,bytedance.com,akamai.com,android.com,vger.kernel.org,lists.linux.dev,kvack.org,googlegroups.com]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: * X-Spam-Score: 1.90 X-Spam-Flag: NO On Tue 20-02-24 12:18:49, Kent Overstreet wrote: > On Tue, Feb 20, 2024 at 05:23:29PM +0100, Michal Hocko wrote: > > On Mon 19-02-24 09:17:36, Suren Baghdasaryan wrote: > > [...] > > > For now I think with Vlastimil's __GFP_NOWARN suggestion the code > > > becomes safe and the only risk is to lose this report. If we get cases > > > with reports missing this data, we can easily change to reserved > > > memory. > > > > This is not just about missing part of the oom report. This is annoying > > but not earth shattering. Eating into very small reserves (that might be > > the only usable memory while the system is struggling in OOM situation) > > could cause functional problems that would be non trivial to test for. > > All that for debugging purposes is just lame. If you want to reuse the code > > for a different purpose then abstract it and allocate the buffer when you > > can afford that and use preallocated on when in OOM situation. > > > > We have always went extra mile to avoid potentially disruptive > > operations from the oom handling code and I do not see any good reason > > to diverge from that principle. > > Michal, I gave you the logic between dedicated reserves and system > reserves. Please stop repeating these vague what-ifs. Your argument makes little sense and it seems that it is impossible to explain that to you. I gave up on discussing this further with you. Consider NAK to any additional allocation from oom path unless you can give very _solid_ arguments this is absolutely necessary. "It's gona be fine and work most of the time" is not a solid argument. -- Michal Hocko SUSE Labs