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 AF7D2C5475B for ; Tue, 20 Feb 2024 16:23:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 418176B0075; Tue, 20 Feb 2024 11:23:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A16C6B0078; Tue, 20 Feb 2024 11:23:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21B586B007B; Tue, 20 Feb 2024 11:23:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0F4FC6B0075 for ; Tue, 20 Feb 2024 11:23:39 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C4A46160756 for ; Tue, 20 Feb 2024 16:23:38 +0000 (UTC) X-FDA: 81812702916.28.7F638E4 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf19.hostedemail.com (Postfix) with ESMTP id 9263E1A0014 for ; Tue, 20 Feb 2024 16:23:36 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ZFzfIWnc; dkim=pass header.d=suse.com header.s=susede1 header.b=ZFzfIWnc; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf19.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=1708446217; 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=h8kDAAJVm9DuuVWWpgF8KUfDBqc/AfjUKVkybEu9ZjA=; b=3JNeNv5kqDbSv/gQvxXaJ2+PQpKWhU1ZbfhGXZAWeGXTPMk3FQd6THC40VdrcuXZNlHnc3 tdWvS/76e9gjBXASOW0+QOiRkysXxWripIw1iB1om9xGM9bpbvLSsbfJ9F8KvTqnF7TQsk Qly9stXfGCxN8/zu7h30TEOLDpW/nlU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=ZFzfIWnc; dkim=pass header.d=suse.com header.s=susede1 header.b=ZFzfIWnc; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf19.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=1708446217; a=rsa-sha256; cv=none; b=HZQmSETdzloDNbMtvsuJKuB69OMZszgooKePVy50h1+tlhQVzIyuDzMHlmo1UV9Pw9ruQ1 CwdeJUZnWo4DqLGFXJG0viI81bcd6LohA+T9anRH3oH8e1pH6UN8kgwf0DNi6zhIbiUmnd C4bg8tBC7hQCYgLAJdlPT3Xa/gB3jEw= 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 9D00D1F8B3; Tue, 20 Feb 2024 16:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708446214; 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=h8kDAAJVm9DuuVWWpgF8KUfDBqc/AfjUKVkybEu9ZjA=; b=ZFzfIWnckCCIdzh/XxcA8I6i/Abl4myhPRohiC29Y1zma2EAik3pIboVw8rsuI2Fk/hf1f X460EYZMpb0V7T5YuVeLML+iBfORaE9Sv7Lkf1cmVnxbV+Gjv5P9Ql1DFoPrxePSCl7R1K RpsOZjPJ1F9Bjd8vgU0BDeIDc4Yw+Ac= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708446214; 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=h8kDAAJVm9DuuVWWpgF8KUfDBqc/AfjUKVkybEu9ZjA=; b=ZFzfIWnckCCIdzh/XxcA8I6i/Abl4myhPRohiC29Y1zma2EAik3pIboVw8rsuI2Fk/hf1f X460EYZMpb0V7T5YuVeLML+iBfORaE9Sv7Lkf1cmVnxbV+Gjv5P9Ql1DFoPrxePSCl7R1K RpsOZjPJ1F9Bjd8vgU0BDeIDc4Yw+Ac= 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 77DA3139D0; Tue, 20 Feb 2024 16:23:34 +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 Dr6rHAbS1GVrVAAAD6G6ig (envelope-from ); Tue, 20 Feb 2024 16:23:34 +0000 Date: Tue, 20 Feb 2024 17:23:29 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: Kent Overstreet , 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-Rspam-User: X-Stat-Signature: 1f4b3kdyzt3h8hbsihpr84sgcuncdoog X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9263E1A0014 X-HE-Tag: 1708446216-539523 X-HE-Meta: U2FsdGVkX1+Jvd/pOoAvRbSYJ/Hm7dX2gCrxWA0yVfX0YeQ3yXMQ275xKMKkxRxiq+4r5wW91DgaMTRIPLtBKvK7kOJCXDVvHMzO+IBgxyCW/16UDWpJiidDDvH3jpI4XVQFwX6vwgmV8w3XPUxaGdyoaIO4D9CsiYR4i3Uu8jA3GVXdAutPFW9iFscYSjRja6A7EDypuzFIxg5uL0msZmCWhj+lDC4GqT5DBfYgUqzD60unPU3j5UHw8zSpwQAVngeGYmoY/Ha0/jQEnjYFe3bioe1577gWP7JRGKAJHlEvLdVkXMgRWpIS07tc8FHTYIsjAg9bLZ85RkVU3a/jJJi9FK6vektK8S3tw/RiZtoghPG6Bw9f6B43q805dsWvIPqSY57Fce7y2JD7/ex+O7cEYARSaJU0E25bIMzvAdhqObQnp+e+9YTbgHcfk53yZCwkjiK4bexddyKZzBlNphwnKZ3AlCVB36sk+jvn/1wYojIsUAdQWLY6akPfDBNEK4swm6DO8VKutMGLIvpl138UAEC4BD4YD58qzI/ippFpJIKqg6oLVgp1IShkAmC8bRCyIetpClzyfKT2QT2Qyt8Aw0M32TKILTKP+Wk983PShqgLDJqrYUiHxYaM6labRhOaiDJMlQLtRFTLKlHmx6kiOBO491jc7efhVq370SChZg02mgZcIUcHl3c3b5Tj9pI9djTHZOmknf16qYoc+d26a3K+mKbLvUZULTh2lbpdKPoG+gP81dbn4ImqHcl7Sw3YZ41n5nC4srMXfaskdLPw5bJc9vLWDBz/i+mhChXoWqwBUe9rTV6rJZJvn5sgKddm1P+V8MIOlqDBu2huFHZI1BxyQ5E8CWrXQANe0pAh5H3r0NdzG4IbLIXfJ9Bjvo1FWQ7NSOViSoidVo3SxkG6zXq8cWbvsbKIsl5qEyOnCvEBG85j0nrNHlonVTeNSLBY/m9FW/7kcNFwxpY /353cGdc R4sLqXlvNiBjdU33Gfc8vMexaMJ3TmOplhVyC 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 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 Hocko SUSE Labs