Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2839006rdb; Mon, 12 Feb 2024 20:34:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwV5ojCl4oNlU7JpnJbdDYZy2C98OFPkN9ZQZY/N2WlMaGpE74Os5GLrh4VbsWaAWzl3rZ X-Received: by 2002:ac8:5b8c:0:b0:42c:758c:15cf with SMTP id a12-20020ac85b8c000000b0042c758c15cfmr7524590qta.15.1707798857052; Mon, 12 Feb 2024 20:34:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707798857; cv=pass; d=google.com; s=arc-20160816; b=HbvamIJ/TjZ7I3E1ymz1Q8EEUUejmc2lZO1IuPhIEURVMW8IaYFty16IQtxYKN74to BhCGZIHJIKV8tM5D/BUUvC9pvX7eokxxlBOKIhHpEWGouZVOaC34btoCnGk/uC6GnVsh jds9m2KjFq95Zxzj/VB0c80IYg5yMMoUvB5XHo+dRAkAhJ/NGZ5dKxsmJ2jwadD2gfHs 444FHa+zZYXFAdc5Bk+bmIptBSWhudaUhaE/DdaVst5/NPyQp4tEc8jwkYek4Lx/C0DN q3FaXApXVAqDUl5eoI2DUBC75SC4tDAGA688aaPhIoYg336yM32pVO16o40ZZt4mYjFH E4tg== 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=DvjY8M+9GsBv1uGSt+JuoCXswHcqrEcE4jibODW0tFs=; fh=muMiU98LaMLSrHpuVMN6rF5vg/BtH8mEr2MpiPfNUp0=; b=jCvPbTGutn2jXLjPIzwZ0qTlmeFN/8RhWcKjZ7xOES9OsOmOG+QMwXzLms8AtIXwp/ XxCvcSZJga00ji77wHgy3wiIU0Ymz6ulqt6Emn3yt8g1czd14b2wizlckwGjl3vXfKMJ yKw2SL8MLKcx5uaOtZGYd+YbU0LQAzmrtMwMgxFIFBoMHXghroFA1IE3kpAJ11E2okUl NvNw0p9sfsO8oc3kManjj+ohZE6J6fYvwtdY3uFZvLBvjwn8SRQhBKRzzV6CA6oMh6Fe Zp7hOf6eozNo3tgCoyS8il06DEv6nagT1hw9P7nqvcXX2RI6dFiVJuq/0QJ07Qvz2azn ualg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QwlyriZv; 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-62930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev X-Forwarded-Encrypted: i=2; AJvYcCW+C3nvEkIJwtgbuYfc5ZtC5mT9fSyEgIQ2Enuv/RW+PX3Yi7BxvwxSCtLk9deoWsjND5TroXDRKRCVlFjRfKZjWYzTXPTYjmKx6gYiCw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v22-20020a05622a189600b0042c6c0511a3si2209252qtc.465.2024.02.12.20.34.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 20:34:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62930-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; dkim=pass header.i=@linux.dev header.s=key1 header.b=QwlyriZv; 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-62930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62930-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 C56A31C23171 for ; Tue, 13 Feb 2024 04:34:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 812CF125DE; Tue, 13 Feb 2024 04:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="QwlyriZv" Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 DB6A0816 for ; Tue, 13 Feb 2024 04:34:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707798842; cv=none; b=e69119ZUFDlvlpTQZ5uTSeM1rYrv7jacV3yTI2fipWXpuAhFBKAzc01muYXKrtDjj/9Ojem1LG27AtdktkfvjRbRvi7tfE3i1ctY61G9xE+Lcl4OUMLso1WwABbdlyKe4w8ad7wcploJhGYjvz+UfVkBvrpmSErzbIgUG5UVt4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707798842; c=relaxed/simple; bh=sG6EaxazJxZQbK5lrByqzfuE2WehLsylAZ4xr7wN43U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nN2F1AmNigfZXHlQJPnY5lyZhrJIfcaMNa/gybwx2EaQ52GTwMd17UDXUiHZXKmzpDyUsoIvaM4xXK0WO5VL+DGlu9wuROYQKGAJqno4M2pz3GXGzU2VMXbLKkEINqkXMVFCoYIY+YKY9sbfvwzv1TNYCrV+FFDhvRjvxFf8Kso= 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=QwlyriZv; arc=none smtp.client-ip=91.218.175.170 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: Mon, 12 Feb 2024 23:33:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707798838; 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=DvjY8M+9GsBv1uGSt+JuoCXswHcqrEcE4jibODW0tFs=; b=QwlyriZvvUgEDsqDWM3/Goy6W6fpTusJKVxYVQG5crPdH4ZbzhmUYA2feK+/zjZ86yJTrY XATKCb+pnbT/aSunErorIF2g2P2QqZtIIfXF6eJUlBLMn/zeLgLoihNGacEQ0wos+JcJ4x o2fTwQd7WKn6r0nEY1D0LzT7vDzxvyg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Steven Rostedt Cc: Kees Cook , Suren Baghdasaryan , akpm@linux-foundation.org, 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: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-32-surenb@google.com> <202402121606.687E798B@keescook> <20240212192242.44493392@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: <20240212192242.44493392@gandalf.local.home> X-Migadu-Flow: FLOW_OUT On Mon, Feb 12, 2024 at 07:22:42PM -0500, Steven Rostedt wrote: > 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! it's just a string buffer