Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp818442rdb; Thu, 15 Feb 2024 17:13:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXET4aFN5kYPNW1bIYbavT6baX1HnuBMDveIMb3P5CvPI5G/qtY/BmkERsKVeUmyWn5M6SX5Rh9M1lTDjk3rgcj6Gb6b4853DL9N9uq5Q== X-Google-Smtp-Source: AGHT+IFavLFXd3qH3YpFu5yRgfsrctyvO9SkBZPhNAcFe7nRt7u4RlTSFt67Z1eFaT/d57h1ogv+ X-Received: by 2002:a05:6a20:94cd:b0:19f:c0d3:46c7 with SMTP id ht13-20020a056a2094cd00b0019fc0d346c7mr5106846pzb.13.1708045987609; Thu, 15 Feb 2024 17:13:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708045987; cv=pass; d=google.com; s=arc-20160816; b=eb+tgekHGTOvid3DkhJIH+8AJx6S6VoH8xIgp6Aa8Tvz47t3OTu0AdickeMjLFnTm3 wQt8ru+HKJMbN8FuVfZUKBrDKPaaAIq/zMs0E70jQnvVUJ6o+PhxZWoWEIp+x5yOnY4x 9HPFFoXvpFzwGCGsURMESl68IXAQC/kQ5yay2y0apwvLngyMgyDC4+qh3TiuRQH2kzqz 7bP74TCuTxcxiaTJGd0SiugUOLRd++U8tCTl7q8CoycaKPcKbtoaDDl+Ty7EkvQpr74t xmYa21neZHaEY4+ABNszCf7boSOOlMflx9AQS3EkTtGOY6WgBkeEd7XCD7mlFQFMFzQy 7jnA== 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=BBDDxkjYnEavfD3mPCDXRmZmPfVkLnkDBgf+7vi9zKM=; fh=xYP8sXCjEJ5CP51l6T9LlZfmVzY6xy06tszhu3TuQ5s=; b=b33SAqqvZLZJhHfSYR+DXl1xTo/6RjPVKzlowZ7A9CTi4IWtYHlUDwmcphz4d9xnE1 0czfI1JtXNw7Ed4u67hkGjXCa6Z7s+zsADAktvpovz5o9NF/Sded3sPLigJ3p/m0FdGF Ms7SSvWu7jGNzwOsiFp51cYeNyH4uP/1j0SxhJ3dkli+n2pS2pX0T5l4+oA2Ayk5/K5M dMNiuOEwf/iXEpyye5+vbRCFoUaPB9fQVQrQ+PeC129VvPsOlEgRYRFJTcjH4mrzqcW+ xr8ku0+zRZ2w9+vz4NsSKFGS40iW0og80radDOaaF0vl+7KdDY3x59qEeJNeAa/E0hm+ G5iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=VwI1BtmZ; 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-67929-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jw36-20020a056a0092a400b006d3c35096dcsi2053608pfb.320.2024.02.15.17.13.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 17:13:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67929-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=VwI1BtmZ; 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-67929-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67929-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 41BDB283A9E for ; Fri, 16 Feb 2024 01:13:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBA301BC5E; Fri, 16 Feb 2024 01:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VwI1BtmZ" Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 2FF431B964 for ; Fri, 16 Feb 2024 01:01:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708045264; cv=none; b=K+Fjhd8FFTycC7JYe1gnurJVv7oTpZZ0Wq0JrfwoD1t4ZPsYwCrOIA1GKdt1FOGqLUyvqgAENKNg2JeGQ7cRQ6hPKbbLvR5OPjmN6YD89QGYQgxiPzu/Od3Ylxtvy2EmXHkodaTXGPNNE0XrpGOlhAJgGiGsBFwMH6UtSXg7vTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708045264; c=relaxed/simple; bh=A52H0dqD8kleqE238ieALR6ZBY6GGUNS1919tKqbDeQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DP+sXLRhEbgDICMyLjZcae2UlhEEuC6mNNuFOd078oVstfIF5c/TeOUekgebCPWASvmJkIA+akR9ZB75Z6E49cDYZg5zCbHZj8KB+6MAQS5zXn8slB+LXtKu6ZVMnvli8yGgcjW9bOroEsCSVzTj2ScVa4R0YNZEF+kpSf2Wxbs= 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=VwI1BtmZ; arc=none smtp.client-ip=95.215.58.177 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: Thu, 15 Feb 2024 20:00:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1708045258; 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=BBDDxkjYnEavfD3mPCDXRmZmPfVkLnkDBgf+7vi9zKM=; b=VwI1BtmZHZ8AkEFSDPZcDAbf2+PV4v1WRQyNv3uIXV1rbNjzQt5Leg53FPjWDtQ/KaxbAn GxjPODEgB7rm5NhFMSI3EYn8tBPiHukc5PvTq1vOA+l7XGhliE2x7w1hLnpYG9dWz5RqKW pX+V+s/4pq5j3IaGneZUuQMv6MupngE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andrew Morton Cc: Suren Baghdasaryan , 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, 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, rostedt@goodmis.org, 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 13/35] lib: add allocation tagging support for memory allocation profiling Message-ID: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-14-surenb@google.com> <20240215165438.cd4f849b291c9689a19ba505@linux-foundation.org> 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: <20240215165438.cd4f849b291c9689a19ba505@linux-foundation.org> X-Migadu-Flow: FLOW_OUT On Thu, Feb 15, 2024 at 04:54:38PM -0800, Andrew Morton wrote: > On Mon, 12 Feb 2024 13:38:59 -0800 Suren Baghdasaryan wrote: > > > +Example output. > > + > > +:: > > + > > + > cat /proc/allocinfo > > + > > + 153MiB mm/slub.c:1826 module:slub func:alloc_slab_page > > + 6.08MiB mm/slab_common.c:950 module:slab_common func:_kmalloc_order > > + 5.09MiB mm/memcontrol.c:2814 module:memcontrol func:alloc_slab_obj_exts > > + 4.54MiB mm/page_alloc.c:5777 module:page_alloc func:alloc_pages_exact > > + 1.32MiB include/asm-generic/pgalloc.h:63 module:pgtable func:__pte_alloc_one > > I don't really like the fancy MiB stuff. Wouldn't it be better to just > present the amount of memory in plain old bytes, so people can use sort > -n on it? They can use sort -h on it; the string_get_size() patch was specifically so that we could make the output compatible with sort -h > And it's easier to tell big-from-small at a glance because > big has more digits. > > Also, the first thing any sort of downstream processing of this data is > going to have to do is to convert the fancified output back into > plain-old-bytes. So why not just emit plain-old-bytes? > > If someone wants the fancy output (and nobody does) then that can be > done in userspace. I like simpler, more discoverable tools; e.g. we've got a bunch of interesting stuff in scripts/ but it doesn't get used nearly as much - not as accessible as cat'ing a file, definitely not going to be installed by default. I'm just optimizing for the most common use case. I doubt there's going to be nearly as much consumption by tools, and I'm ok with making them do the conversion back to bytes if they really need it.