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 AD16BC77B78 for ; Wed, 3 May 2023 07:13:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D2496B0074; Wed, 3 May 2023 03:13:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15BC76B0078; Wed, 3 May 2023 03:13:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0234D6B007B; Wed, 3 May 2023 03:13:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from out-17.mta1.migadu.com (out-17.mta1.migadu.com [95.215.58.17]) by kanga.kvack.org (Postfix) with ESMTP id B37A56B0074 for ; Wed, 3 May 2023 03:13:13 -0400 (EDT) Date: Wed, 3 May 2023 03:12:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1683097991; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sa4OTZB5b+skGudhSwhmk32TbWUPA01HpPa43R3XypE=; b=houGGarhoR27PbchhA+QNGA0saxVkWBHqqLXWwcgql8ghPJpiqqLxuMJIsQYxFnIsotmiT R5cEBBWaIeU7VnAYAflrCrppJkt964UNglx6jVLEs7TCm33He/1Trw4Kd39bUM2JjWBSVm eV4n8fttF9Y1FM+uRWMMQaDs/kiMrwM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andy Shevchenko Cc: James Bottomley , Suren Baghdasaryan , akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.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, 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, Andy Shevchenko , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Michael S. Tsirkin" , Jason Wang , Noralf =?utf-8?B?VHLDr8K/wr1ubmVz?= Subject: Re: [PATCH 01/40] lib/string_helpers: Drop space in string_get_size's output Message-ID: References: <20230501165450.15352-2-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT 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: On Wed, May 03, 2023 at 09:30:11AM +0300, Andy Shevchenko wrote: > On Wed, May 3, 2023 at 5:07 AM Kent Overstreet > wrote: > > On Tue, May 02, 2023 at 06:19:27PM +0300, Andy Shevchenko wrote: > > > On Tue, May 2, 2023 at 9:22 AM Kent Overstreet > > > wrote: > > > > On Tue, May 02, 2023 at 08:33:57AM +0300, Andy Shevchenko wrote: > > > > > Actually instead of producing zillions of variants, do a %p extension > > > > > to the printf() and that's it. We have, for example, %pt with T and > > > > > with space to follow users that want one or the other variant. Same > > > > > can be done with string_get_size(). > > > > > > > > God no. > > > > > > Any elaboration what's wrong with that? > > > > I'm really not a fan of %p extensions in general (they are what people > > reach for because we can't standardize on a common string output API), > > The whole story behind, for example, %pt is to _standardize_ the > output of the same stanza in the kernel. Wtf does this have to do with the rest of the discussion? The %p thing seems like a total non sequitar and a distraction. I'm not getting involved with that. All I'm interested in is fixing the memory allocation profiling output to make it more usable. > > but when we'd be passing it bare integers the lack of type safety would > > be a particularly big footgun. > > There is no difference to any other place in the kernel where we can > shoot into our foot. Yeah, no, absolutely not. Passing different size integers to string_get_size() is fine; passing pointers to different size integers to a %p extension will explode and the compiler won't be able to warn. > > > > God no for zillion APIs for almost the same. Today you want space, > > > tomorrow some other (special) delimiter. > > > > No, I just want to delete the space and output numbers the same way > > everyone else does. And if we are stuck with two string_get_size() > > functions, %p extensions in no way improve the situation. > > I think it's exactly for the opposite, i.e. standardize that output > once and for all. So, are you dropping your NACK then, so we can standardize the kernel on the way everything else does it?