Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp528936rwr; Wed, 3 May 2023 02:14:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5W+sCCYcNA0fDbGL8hvlbuLTnGvfIJ/O200Rj8B+fMxYn7eMRhy/KXr43M53Rkl7IF2H8h X-Received: by 2002:a17:903:32ca:b0:1a9:4601:a7c9 with SMTP id i10-20020a17090332ca00b001a94601a7c9mr2182696plr.12.1683105267076; Wed, 03 May 2023 02:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105267; cv=none; d=google.com; s=arc-20160816; b=tvMUkjOEHEoCoulaTLapY/X32Tc+K38yHpNgun5bzRqgfahoG+cuw371ts8C/W1Kns 17yka47IsMmcSqeDY3T4OYKadWNIDNTQi6pQkWkP0d2a1VJBmRkp6ImS9Gg7SKLLIPxh VbzjLiyEtpaaLno3NrAkDXNwqhwCjS7QapltwK+jyFO8hbgXtTqkZ9dWIyM6azPzh2ss kgQJGCUeJ5aADLxadJ3qt+X2gEgpieGwX5GFGO0RTqCJeS/G4ENuTyjwPhE2CuceYC06 I29bZ3nYZLBpJLIicuUpCdwuX3xakYBQjUf6Gyu1nHkhaOV4eMNdgIN4wpsiAFkNa83e /Lrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TEZd+b8sulXt8fKAN8kz+Gm51fXRGcBOvDO84eUPrqA=; b=PTYUZNBDsVZtAyQaeJgp6rC4QQXYBp60zyeZmqkXgvuv6CZPOGQ16IP6muuglXH4uE BVBDpuxFktZcBo9IQoCKg9oK4QcHEAhh14z5eDTLOtnj03Uz0cAJCF5AdQwhRA7vlRN0 q+2NyLIvBdz0rCbZ6JqhNb+Z4nwCa44N4uUqNI/xinlCMYuU1e2hOnXNcnkp0E/fBjXb AWQK5REM1yvQQakHsXrsqqlGQlUqAVo6TK1YKGppB59pehYtE0Fe/V5tMIHZEjQA1B+B qDp5TwD+zZVCm22PDGq+qEiNKyzm0J/Z/ZZALVbjYgMG1CH3ZlrvERqKK+XpQ9RKlHFh LeDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lkpnSWbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w191-20020a6382c8000000b0051b75d13052si31683929pgd.408.2023.05.03.02.14.14; Wed, 03 May 2023 02:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lkpnSWbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbjECJN0 (ORCPT + 99 others); Wed, 3 May 2023 05:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjECJNS (ORCPT ); Wed, 3 May 2023 05:13:18 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CB155BB; Wed, 3 May 2023 02:12:51 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-74e12e93384so213824985a.3; Wed, 03 May 2023 02:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683105170; x=1685697170; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TEZd+b8sulXt8fKAN8kz+Gm51fXRGcBOvDO84eUPrqA=; b=lkpnSWbImRhXpMdXf/j2tYcHtARa7pZxpe80UwOhD4R61KpJDN5E6c3vkOZJZtEsdd NIOFyi6+CcEllvCmz+ezBqynxF+o1JnKK9z/EV67UWGPh2kFZbUVxyRHZCZkw1kqq8rz D1ODfYDy+ZvYfj3AH/q3S+H4OrTddDujLMLoFoZBIeqfcAukFwbiQa/sO0taRXV/GD4U O5s1H1vUGlkYsqkokTGq0Ace+9Jt9tMQ9MhYfRBameD9A6V7QtQlcyepsIhLTlDMhvcT QESiwW/ebN8bNURL5Wk9400Ojw9jq2OZaVXEW9BBl9Ohxc4ib4YptZaU3URY4a45BJzR laiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105170; x=1685697170; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TEZd+b8sulXt8fKAN8kz+Gm51fXRGcBOvDO84eUPrqA=; b=U+Nyzb3BdTcOJy/b6wqEVDe3rczisUUnHhEjmb90w9oMU2qFPs2cGx3mkOIeXZd7DR PjwOSeVNiQPOB3ubjVP5unEZ/NH3n70YMPcZkB+SdXDVhylx/qPmbdnxoTbcS+QhlrX/ v/+xZDZ6mQ5M7w8dg/B1BevFNwnGXCVK/o82UsooLOZ0r+Bt+cGY2TdUOJJD8BHHRTtP iegfJlFdxSLeXI8//CFtr+KczfEuLawJpVaESC6ooeWDxSjOXPAFBNj42/YrxNhHfyNA G+zcuxkgOd3nYXmDRlrzJjashsamD1DIzNERAcJElXQJT+ySoL4YPU9co5PtOm1ou0UY uLJA== X-Gm-Message-State: AC+VfDwrD8/mWpZq+gL1WzHthEszccxtT/uwzgUbGqmzwMfAE7MAS9xC QWbS7z6whmPTVqQ02ViNe7kMpXkaCbck+iOflYE= X-Received: by 2002:ad4:5947:0:b0:5ca:83ed:12be with SMTP id eo7-20020ad45947000000b005ca83ed12bemr11144076qvb.21.1683105169929; Wed, 03 May 2023 02:12:49 -0700 (PDT) MIME-Version: 1.0 References: <20230501165450.15352-2-surenb@google.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 3 May 2023 12:12:12 +0300 Message-ID: Subject: Re: [PATCH 01/40] lib/string_helpers: Drop space in string_get_size's output To: Kent Overstreet 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 , =?UTF-8?B?Tm9yYWxmIFRyw6/Cv8K9bm5lcw==?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 3, 2023 at 10:13=E2=80=AFAM Kent Overstreet wrote: > On Wed, May 03, 2023 at 09:30:11AM +0300, Andy Shevchenko wrote: > > On Wed, May 3, 2023 at 5:07=E2=80=AFAM Kent Overstreet > > wrote: > > > On Tue, May 02, 2023 at 06:19:27PM +0300, Andy Shevchenko wrote: > > > > On Tue, May 2, 2023 at 9:22=E2=80=AFAM 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 ext= ension > > > > > > 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 peopl= e > > > 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 wou= ld > > > 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. This is another topic. Yes, there is a discussion to have a compiler plugin to check this. > > > > 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? No, you are breaking existing users. The NAK stays. The whole discussion after that is to make the way on how users can utilize your format and existing format without multiplying APIs. --=20 With Best Regards, Andy Shevchenko