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 5BD89C5475B for ; Tue, 20 Feb 2024 17:19:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ACF5B6B0074; Tue, 20 Feb 2024 12:19:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A7FA96B0075; Tue, 20 Feb 2024 12:19:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9470B6B0078; Tue, 20 Feb 2024 12:19:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 857316B0074 for ; Tue, 20 Feb 2024 12:19:06 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2BB661207AF for ; Tue, 20 Feb 2024 17:19:06 +0000 (UTC) X-FDA: 81812842692.28.3425955 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by imf11.hostedemail.com (Postfix) with ESMTP id 55CF840013 for ; Tue, 20 Feb 2024 17:19:04 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZylNuoqF; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf11.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708449544; 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=TFBMvCwRxxn7Ubei4id/yHwyn/BDb0WjYtVEnoOd25s=; b=iIqFEtHsUdHwPZr7fV2njByeNlJnTljRD7IGMqfl3HFIh2DYjfA9zJfcl9t/urGa/MnJqf pdTL2GDTynXjoRDCh8wQ/Fos6MHWF5xjhomv6c/WDJzjLsm80QIIRC/sjxDeBdXmhuNdtt Tyr/Tlam9UcjHU0kjSVG+hMfc4RI958= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZylNuoqF; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf11.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708449544; a=rsa-sha256; cv=none; b=zfbr/4/mocWAnRO0QDYHCdetZx8ht3UlFmI6Gg2ghstdv8zdXsk4pkROr0MKxWKgU/Y33f iW2zQgo3ICdHP4zJRm7eKhAnudb4koxPUBLE/ZHrsKINGbbFiLgtdIrDPrHY+2+6FQ9XKL L+yfmTzE0g82sh/39ae3taBZBp0CvTg= Date: Tue, 20 Feb 2024 12:18:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708449541; h=from:from:reply-to:subject:subject: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=TFBMvCwRxxn7Ubei4id/yHwyn/BDb0WjYtVEnoOd25s=; b=ZylNuoqF0WKUPQen8SuTjXEKNDhM2Ex2wqwBoEJf60+6TaajmwkB70wpiPVQXYu+eoYCUR sUKS2cANH7nSCOlWQUjFI+HMnkIwXo0ZHXqsAjV+pF8AwlJ/TOPjGDnpbzkNBHPzZ7uLrX c3XpOWsBmNaK+l1P89corGdUgfBt0Rw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko 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-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 55CF840013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 3uifz6mnkmawfbhkc47cktcw683c916g X-HE-Tag: 1708449544-430376 X-HE-Meta: U2FsdGVkX18b/+/K9SGSuXe1mxCsyjXG92Wi2u445ErQMk7vKWIgxpPSBpOkyPeLHE2l/T8P3BQ0yg4eKr2GDvOW5TpvYk336YMAFzuSZWqJx/SfNGZ2aLqBo0d+PUMFq5OA8QtWG5C/5fiq7NA4Xz0lQqdoToC+jE2cgFtXB4Mbpqfo/6YKQ+DtTufapyRmwXkxDg6Ea2efrlGElkkI1x61R8n1ycqM3wOJ4jDYrRRZvwokqTaCzabUk8Jr5Di/NBcAInmEvUWCf/JS60ufRqz1wrKJDP7D77d6Fy8iXfUobIk9Kxx2Y+BLJoSDn986M7qvTDP022K75ThRoZ7m1qtIPfox6JTx4Tt/dus7VGhew76+JqWTuCnCAC666lWQogSaY/xy/tIyXntDFhixBavhN1EnyYu/eoDwtsPNyJzu0K+mDqEnQXLxGIWXiyOcs+YnZeE4FxfK8+hBwof6Amza9H8OFNLKFR6Sit3Dp5GdPvP0v/LB9RgiUmVUwu2Hpyy5Lh7E7TNfEHq7+9EiPxoBv25kcs8k2HNbsUqmu85lVeHV7Li+1NML5hd9i2XrzwWJwDHhrnPx7cmJHYp5bw2HXkASP0tpSMWrZl4/4PopM2T1kIy7/DHeYGtyOKk23pHf9l2K+T8MijqOY5Jrk6r6cywdJv8PA/icGHwDIVybKEQGMRkA1ZJXVNCBPVHeTChy3ebybrjL+WreCQupnVwBRAgmcOhtxbie1lv+DjtDVSJRQEtXg3rNM7AGFQQt4UU8EG78xBDSS9va/54vpDYHiY5OHE+ErjdM6WqGt/eN/K+U/l1W3X7dbLTbr0nfQ39lTETwwmciauESH7hnzt8IZ3Wfax4LGThrlZKA9bViyUHNLSGq5WSgwQtXfMcSJ7iRwyfFROiVQgLdfSfMykU1KFaiDgYT 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, 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.