Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1872107rdb; Tue, 20 Feb 2024 09:19:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXx9t6MqBWEGIOG7fDT1g3X6lUFkZAvITGUK0tPueXQu4SKNZ16jb+pjAqg5PoZrnz7Jr02P1TIUaArDsWE9DaQ78DdFwDnLIFLXJF4SQ== X-Google-Smtp-Source: AGHT+IH1QRf4tq1OueTW/cXwYvitImw2a5FYYbbOXc8UQu3zuCraYKgpxlow0bHOjwJUFLbgv4b8 X-Received: by 2002:a37:ef14:0:b0:786:9b73:3a0b with SMTP id j20-20020a37ef14000000b007869b733a0bmr16145711qkk.41.1708449591533; Tue, 20 Feb 2024 09:19:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708449591; cv=pass; d=google.com; s=arc-20160816; b=dxbFd9eQ8QU9EtMDv7NkEmDrY/RG3XLv97mwnxsbgu6Fh9B9JmL/RDp6VpyeqRHZd0 HKS4LJI1X8334qhpxhL09fO5wBbmrU+Ty4JEp9+l1RrWI//vwVBt/k19od8qlo6kbuWF MlSx0f/MIVers8AKcqeckSJMg/Tolw1UrscVdCx3Gs22tD2iQk9DB+i100wZsqIanqhd BC/TclXvn/WF6hMZ+4LFzjZNdEXA33UZ8mo6O4ULBRZC8BAu7Iy8aIRsC+AianIF0fta giL7SLrIG9NjRno6efXTA/FLbR0DtDbQr0Yfi9SHLMI10brifyZ4xIC8Qh2gVXNQOLGg u7nQ== 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:dkim-signature:date; bh=TFBMvCwRxxn7Ubei4id/yHwyn/BDb0WjYtVEnoOd25s=; fh=cdnrFe24HzwWdEILUfE8iAnKpZWbuzZYUVYziuBEAhI=; b=E2SGTktmFnQ4w1CVstsDgGAOcP3iYed4FhC7A25aaUdNZI3Bl4UWtfbAy2xPDC7ImV 43ayIneQS1Hjj/BfeuDolGOVn5gz9QHR6zE7QClBHo8QN+C4GFtqIyNpbQcmCsV2bHz3 OLFwnE15gTzC62teBtl0jKS4Dwd5mEdP+1j0pObiTQnac3qGd9+zcB8b6SIs2CVFphY/ B6ZpFlREAZWQ/k08JJR3dt5hlRyrSb0t8rHf+5P+cH4FWzk9tlQOO94m0H1e8tyR/3uz fBX2LJOfPB2rR8zRmnWgwPZQA4bjr3AC022KVUSocpNWiybQBIwqAm41JR9803PsNiFd syEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZylNuoqF; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-73424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a11-20020a05620a102b00b0078768158e32si4944253qkk.476.2024.02.20.09.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZylNuoqF; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-73424-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0FF1D1C2272A for ; Tue, 20 Feb 2024 17:19:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75EC5779F5; Tue, 20 Feb 2024 17:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZylNuoqF" Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C504576C94; Tue, 20 Feb 2024 17:19:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449545; cv=none; b=E+ooGkgIpjS+lQxjFLp2AflP6XXQ49LDle9JjL+7cW8rK5HgLw2mk9/TUwSDyePW9B7zyUxv1f4cRFEOyrGnXmxah1QApdTbATOxg4FU2gAsKy7KfXtg1wdRyATDdzsu/s6y04mt7usOXEuFl/ZjOYuKpkko70QyTY2L6G/Xl8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708449545; c=relaxed/simple; bh=qY/gICxbLEkSnEgQyrbs+LyV/tRdFeA2GPaxJlaMch0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cfZt53oHgweBJDrD/+YyuRLiUQW+NZS9rBK/Lh9nP7qRYFVIn9plhXfHMRoQcnVP05XT6a8xO8EABCCJcWCJp5Zd2pYej1CclVMy265Jg2I8Zwvp/7MicaROtNs3shMqSGg8OXHspH6AvKvigmA4vNJ4ORk9kU0u0APBgg+QpR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZylNuoqF; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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> 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: X-Migadu-Flow: FLOW_OUT 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.