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 06B8CC48260 for ; Tue, 13 Feb 2024 22:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 929646B00B4; Tue, 13 Feb 2024 17:06:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B2BC6B00B5; Tue, 13 Feb 2024 17:06:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 72C988D000E; Tue, 13 Feb 2024 17:06:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5D8DE6B00B4 for ; Tue, 13 Feb 2024 17:06:43 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 277B4C0D1C for ; Tue, 13 Feb 2024 22:06:43 +0000 (UTC) X-FDA: 81788165886.25.178D8AB Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by imf23.hostedemail.com (Postfix) with ESMTP id 0CD0E140023 for ; Tue, 13 Feb 2024 22:06:39 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rGEbbs21; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf23.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707862000; h=from:from:sender: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:dkim-signature; bh=zK5QLIW85nz1zVFqkUnOGvmwzlA1XAn7Um1knwojFcg=; b=TGa+3NR98i+TqrYSJoJzTKgCxLX24Zm7PcpEnozwm2mxLnxuL+k1Ukb4F27y6jwkIXiZRW FUU6R6am9CfEgcxSeeN2dAgk8a9mepgkuvikvy6G/TjmCp7I4/OCL/fImtn9deTeUVKHmk fObQfb/u/SJOLsoXE7GjelzS9tBheco= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rGEbbs21; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf23.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707862000; a=rsa-sha256; cv=none; b=UeXjYOiq5zo3Rc3L2IAj65sg7gAvDmoIIm2Nve7xB/n1+vPh9whNzjf/mUtgxAJPOINo7h 1pc2ruOpb9NPXf3wEHrQRn2VOpeHkR0OEkQwlvw/YB8jsLufY6v8FXSN5TwcY3YwqWLGjh sPLVVOEgjskzgJ4fB79GKxihFOxMtCs= Date: Tue, 13 Feb 2024 17:06:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707861997; 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=zK5QLIW85nz1zVFqkUnOGvmwzlA1XAn7Um1knwojFcg=; b=rGEbbs21+nZYs0/9vmfeL0lWowbNK/eT6L0AAMRyacfOwuZ1UFFsPh7Fyvq2Xojp6JQO3z I7a9ZOt20XcGXtOfMwojqqXm3BemtyWhDrnkPQ04hJB4GRJnSJWu7AdXBizsePAbXyPZtC CS546SLxy1lnuwZShsLcF5/EaSRxDxg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andy Shevchenko Cc: 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, 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, Andy Shevchenko , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Michael S. Tsirkin" , Jason Wang , Noralf =?utf-8?Q?Tr=C3=B8nnes?= Subject: Re: [PATCH v3 01/35] lib/string_helpers: Add flags param to string_get_size() Message-ID: References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 0CD0E140023 X-Stat-Signature: 7oaczks8tyhq7j7m5c7d1caj1fw8y373 X-HE-Tag: 1707861999-794024 X-HE-Meta: U2FsdGVkX18ubLNr+y4UZxaFRBQBlWHwB7o6j1F+O32IgD/SRk/MS/oMQElGzxfyoYp1jiyHwBmdHSdDq31YbV+w7tGEYO1lnNTVTasNsr47CFgTTuJio3FKWa9k2Ac9PHeoCACpPk5sXKRDNhfx2kgC5k3PbM0woI/d/XG+YNHSSdB6vBuqnQ20+PMkiQokF71/U5suMR5frT3Ras6KRcffzyf8s9ONHqexRZwS6os50pGcNo9NvJ6vuS5pbks80IX/Flc0L0IDVgeVcy7dRGysG9iTlGWH2p35dFJtrX3xIHKZt53KGf2+cd5hFo486QGvV3EXdsAxHFKjWxrG3bMoW4pJTRxU4fgEmb5MNycZFrLBApC14IlKDiIA73jsOEIb0OLIJGHY7xdf66IJEk+PZMzDzDFEUVhYmcuVi5ei2ZEdvnrYpBCxK1HjUEXzmy7FUWgxVsv1D0b4I3YeWvXYz4geSNRT5XHXXxw7d+tffFr18YvmfbC5+LjxQ+sZFZGjaXVJhXRuiN8XzEg0ov6OAfYX4VsVFW6DMr5wZnafeng4qQutF3Sr0iF4Mc6k/J2qk0aFQTCEANFRM/LOI+4TdipJFPPyD/l5TonZPD1bxJRcHVobvzyKJ+tRnmWdB57dGs2RejZIlvhbjksZTHvocQWrn+xS7r1fiOKfuDhIE7OVJFmpoaO14UGJdcN0nE7g7oLJFWCcdHHDRKOAK2jun6zayWF5B7edQaj7jPm5nfpOZVz/FzON+mmbUES6bgK4daDAza2hobBR2mwbSOBigTC9KuFscp2OCPysHzMEBxtgH/at7ywttEUIZjtoqBhkiLqPRbz1UMZdZTSprQvJ5nr6y0LYsaU0wRR+FVnw5WHf7wGCWJML1E+xGhzsGXaWUnwzgSrorJ8bAEWeMMsxWt7IPmIXZG9hWYv4j5LDfksIgNKWy3JEBBal8zSi7g118uZZDZAGIUY0LYI w6WjKdPL 977pDUh36Oof0m7ZXWZ3g9ErGSwH9fb4PYNDU78Flu+SyJcKv/KKy6MWw6HefHrTVgsuGtTTkaOSHtikabSt8ySfJSBysppxmhsKdjB/kXPsznCeUIcou6VsugBXIzztIEt7zoAsKXYCMNW72kSLs8Pym88hee3K+J7iXSh8A7XEmWRvwOA2DKsdqwiQQVpjOucRdz+ANoCrP+tXVUrWZumDSLrCaYrhsKIk8Yqh5DT/0GEX3dWKwj0/+Nr9JlVAYFp2lDygGeY1XjxdqRvx28UPp+AgygpPUW4tsEKwpai0HqYG9BEPwUBRlv/Vv4WCFeMMzUJLslbY3qOPyVcKc8HglOoUgTNQRDIChwyu3vXFf7JcxjDDq5cnHSH840X61laOGGuWRzuL6FCtjaOKEFt02H1d0dUeHyjL1lGHp1bE2QRGjFNvteC3uAcRtzFtD8t/W3+oxedJF9A9eDbk4P4yshm4PjeCkvrzb 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: List-Subscribe: List-Unsubscribe: On Tue, Feb 13, 2024 at 10:26:48AM +0200, Andy Shevchenko wrote: > On Mon, Feb 12, 2024 at 11:39 PM Suren Baghdasaryan wrote: > > > > From: Kent Overstreet > > > > The new flags parameter allows controlling > > - Whether or not the units suffix is separated by a space, for > > compatibility with sort -h > > - Whether or not to append a B suffix - we're not always printing > > bytes. > > > > Signed-off-by: Kent Overstreet > > Signed-off-by: Suren Baghdasaryan > > ... > > You can move the below under --- cutter, so it won't pollute the git history. > > > Cc: Andy Shevchenko > > Cc: Michael Ellerman > > Cc: Benjamin Herrenschmidt > > Cc: Paul Mackerras > > Cc: "Michael S. Tsirkin" > > Cc: Jason Wang > > Cc: "Noralf Trønnes" > > Cc: Jens Axboe > > --- > > ... > > > --- a/include/linux/string_helpers.h > > +++ b/include/linux/string_helpers.h > > @@ -17,14 +17,13 @@ static inline bool string_is_terminated(const char *s, int len) > > ... > > > -/* Descriptions of the types of units to > > - * print in */ > > -enum string_size_units { > > - STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ > > - STRING_UNITS_2, /* use binary powers of 2^10 */ > > +enum string_size_flags { > > + STRING_SIZE_BASE2 = (1 << 0), > > + STRING_SIZE_NOSPACE = (1 << 1), > > + STRING_SIZE_NOBYTES = (1 << 2), > > }; > > Do not kill documentation, I already said that. Or i.o.w. document this. > Also the _SIZE is ambigous (if you don't want UNITS, use SIZE_FORMAT. > > Also why did you kill BASE10 here? (see below as well) As you should be able to tell from the name, it's a set of flags. > > --- a/lib/string_helpers.c > > +++ b/lib/string_helpers.c > > @@ -19,11 +19,17 @@ > > #include > > #include > > > > +enum string_size_units { > > + STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ > > + STRING_UNITS_2, /* use binary powers of 2^10 */ > > +}; > > Why do we need this duplication? Because otherwise a lot more code would have to change. > > It seems most of my points from the previous review were refused... Look, Andy, this is a pretty tiny part of the patchset, yet it's been eating up a pretty disproprortionate amount of time and your review feedback has been pretty unhelpful - asking for things to be broken up in ways that would not be bisectable, or (as here) re-asking the same things that I've already answered and that should've been obvious. The code works. If you wish to complain about anything being broken, or if you can come up with anything more actionable than what you've got here, I will absolutely respond to that, but otherwise I'm just going to leave things where they sit.