Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2771925rdb; Mon, 12 Feb 2024 16:47:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGo93KXnGuNmOP4KKw3HeCYQsRgGGHt2rmMZb/NSwslWY8VA/Z1kJ6dzZHorsIYCQnDC8T X-Received: by 2002:a67:be0a:0:b0:46e:c3d2:6e18 with SMTP id x10-20020a67be0a000000b0046ec3d26e18mr3141755vsq.23.1707785251297; Mon, 12 Feb 2024 16:47:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707785251; cv=pass; d=google.com; s=arc-20160816; b=N4C5SYb+7qcqcoFrJArq1NRnOrqMZqOiWP+8EdsaADsml1UVBY71h0sdTF2nR7V1Td +4NKIiV7eZka24r15ieG+2kAVdQRrrFqUqLtMLEP0TKnDFr3OKoRx7ruy2Rr8b2YQPB7 IehYcZqEhmWkkbKu2Lu6ebK8OKfy7xKa5Aq+yEKB6TqzqahzLTsKgX/1/3/cmgTq+bfH q2tzD5oaBVUScoDrc2kVo+Ry+XfqK5Msm9eEtrvJQnEZ75qNNxW/t7KcacUvOHQKi5i0 vT9KURi8+f+Cc0OZrn6zsVMZ4j4uLSp9e5aP3KZHx+msUmpOOwBPqxhOy/Qp8bfGGG6Q 2G3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=CaCpyDeHXDa+8CkGkZ4BeT+7NNJLDIM9RFOacxKeyRQ=; fh=g78mVsxTEoRCxAA31KHiR77eF+atd6efpGh0Dk52Pkc=; b=BZIPjC5aQSdroBkLIm0mk+z60aisvSdlezjO/IkiXnSXno3YDSsmejE6bKU7UwVTOr NZNhgKkIyu57asv5NwHlvIRqp3TRrNb6KHl6q8CJvw+3ikgWq6j9ZYERQ8PB5EM+OaVl xoJ3VHyvefvk6aIsN5XO3sTYhDP6e+YAKaAOt+zFXSbXwrae5RMiZXQyi9JryVbrMcGL NQoYq9hSDHnvuZ3uXcRMMeXYvwmv0yWGHAdRECBOU2UBfphY5oEN82SccXRMU7IQIjc9 bxjQOT9UNr+cbATwAv3u+s5aslncQINpKn5gHpqvCVhAmHZd8WaY9BF2Z2H38k/S1KiF 5hmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-62675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62675-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVLA2jCUMGFtQ8zaBh73oEczW3A1PgN4sOCpl5TkxpYJHXXf0ahkeZDtBY0StLoO6aM5h16x/ysmIx7VP9Dtl1dIVRM0sqHf6FLrcRR0A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 4-20020a05621420a400b0068d14b3ae2dsi1655258qvd.605.2024.02.12.16.47.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 16:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-62675-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62675-linux.lists.archive=gmail.com@vger.kernel.org" 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 0EA8C1C238B8 for ; Tue, 13 Feb 2024 00:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58D5C65BD6; Tue, 13 Feb 2024 00:22:07 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B90CA657C1; Tue, 13 Feb 2024 00:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783726; cv=none; b=B6Kd8NG0IqN32SgiNkipxFatpfddqB4vLV/gy58xCk2sw+ck/DCvZnfx33eKC1UsroNvbehWuVzQpwUT4PGhti3IVvSt6nUfP2io46E7QmB6YbEKG7cMR3SW7DVCSKAH4xXm0LnZ6FirY1bj9AxSwx1FKwLhaxsrE+eqMtVdXLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783726; c=relaxed/simple; bh=noY3yf17t8mOkaySw87fwbJJodozX5gvpalHBVzPw5Q=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I9GP1q591+9htsbCpGkFJY7i+xbPy5fAxX3XFbaGvsy2QOIjtHlK+P5uxu3RU0PVB9DAbwEuqt6EqOaGUoqHLTxrZ7JAvUpdt9eejUPy4kHRUyfkYCCmvEariWANvXfsclFdILsQP9whF+qqapZFSnPybCEri1YQP7IrLt1l4v4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ED59C4166A; Tue, 13 Feb 2024 00:21:59 +0000 (UTC) Date: Mon, 12 Feb 2024 19:22:42 -0500 From: Steven Rostedt To: Kees Cook Cc: Suren Baghdasaryan , akpm@linux-foundation.org, kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, 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, 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: <20240212192242.44493392@gandalf.local.home> In-Reply-To: <202402121606.687E798B@keescook> References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-32-surenb@google.com> <202402121606.687E798B@keescook> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Mon, 12 Feb 2024 16:10:02 -0800 Kees Cook wrote: > > #endif > > +#ifdef CONFIG_MEM_ALLOC_PROFILING > > + { > > + struct seq_buf s; > > + char *buf = kmalloc(4096, GFP_ATOMIC); > > Why 4096? Maybe use PAGE_SIZE instead? Will it make a difference for architectures that don't have 4096 PAGE_SIZE? Like PowerPC which has PAGE_SIZE of anywhere between 4K to 256K! -- Steve