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 EEC40C5475B for ; Tue, 20 Feb 2024 17:24:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EFF56B0074; Tue, 20 Feb 2024 12:24:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 776A66B0075; Tue, 20 Feb 2024 12:24:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A2C26B0078; Tue, 20 Feb 2024 12:24:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 430F56B0074 for ; Tue, 20 Feb 2024 12:24:51 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D9E701A074D for ; Tue, 20 Feb 2024 17:24:50 +0000 (UTC) X-FDA: 81812857140.23.E9850CF Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf09.hostedemail.com (Postfix) with ESMTP id 81FCF14000A for ; Tue, 20 Feb 2024 17:24:48 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="aQPLcI4/"; dkim=pass header.d=suse.com header.s=susede1 header.b="aQPLcI4/"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708449889; 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=t4AkBXTli0JY+7cZt6wPmw2DkCGDriEpGC9jORxnoKQ=; b=l18Mt4Xgz04PLiVAdDZnV/dmX+H3JnU1Ka0ou5JLZY8bvZxS/kX5K8qIMWcNIKvYRjSumq gpT4EL4wB1YmdztkGZ2Y1YPviVNAwdOYI4pm7kwmOjm4H0L/zBwcw7Bujik0dFsftb055W ei5zjWCPdufBbC5Bq0XZoAno1kvSK0Q= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="aQPLcI4/"; dkim=pass header.d=suse.com header.s=susede1 header.b="aQPLcI4/"; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708449889; a=rsa-sha256; cv=none; b=yoBh9MewdO/1ok8uTE9faxASQ4ij5V6llRIC3ycus+SHCCR5zLtIos3VhG0wrNkgAKrpWt BeDV4+kQ9Y9L3t/B0vy++mbjrzZx+s5x2OC9VWkN519SX0KADNwKknpA33pT+Srl5jqD9P ZXeFEHVN2BMFyJy9BL3xii8IKWZicag= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 A57631F8B4; 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: / X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 81FCF14000A X-Stat-Signature: 7ciniytc48s43icfxzfkof3y58wwwbwn X-HE-Tag: 1708449888-594723 X-HE-Meta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NEgOvyCD8rYz/g1u+WTlCcDguKvcgWBWc25OMH82ZPUPQzamCPOYiX/33QPJWVCE9ptRqMO8W3Aav3p1R+8wPaoxllcIokOdPThNDqH4eeWve0ar6vaeyqzyP6T2FKKCf/2UECLRdwdwPW5Q4f7ecSHS78RuvGc1iYeKj8zW1PndPRM/Kp1WMJVfKYvZX3QVr5jol3nEnnvvVN+tBMMN/r03dByQBquXodLb9HrrZYSOE/0QSda/7fSDs= 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: List-Subscribe: List-Unsubscribe: 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