Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6503167rwr; Tue, 2 May 2023 01:05:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5uaYcIHY/P6Q/3sXhIeg+Qxf0MktOcXhgma6/DXOWEbBTUz3d0BXy2CIdMHuSFBJ5s8G4j X-Received: by 2002:a05:6a20:3d2a:b0:eb:6e43:8e1b with SMTP id y42-20020a056a203d2a00b000eb6e438e1bmr22238469pzi.30.1683014708987; Tue, 02 May 2023 01:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683014708; cv=none; d=google.com; s=arc-20160816; b=J4sIdV+FFaw1PxbbXg5FplJbz82LwN4/K3vs/4TPmj8r4Lv/wi5WmiKYMGqkp/iPXU kf985tKOgSJ/GROoMtzeHBnnTNJe6qJ0Lz816v6L9C3MixOylJPfoJcIpr5wRHI727gk 10NcCNXAIflojuVKagN9G1kdBtZxEJnRgSKhr/NUYF7g/1NWHMNOxKucVf41IAJ+oiAM lOKu249co+OKYgniKvSILfoZkb0P9eJtwDsV8L5NqmEMMCoHU7zPK/XmwGG4Zpofg56C SlWtCjzYyNfm0GqEB1rhA9SAwxfTuCAQz3JFJFAenxcjI0tylZDuY8vyibJD9bGDTqLw JIrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=apeaqOGW+aTexMxtULNJKmBXy2F9o3DqQn1p3+VDVEs=; b=b81fYuQuR9vjjSs83IkgrOJEZiixI3TnJLqIKPDpMmzEB/sW2YR9a1TN/yLiqsCW/E z6e2fioVSqnitNnotG5JmKr/qKL5+x2IAtNnodcfwmf+W2vGebYJWs+rbZihFkL0uQlk bVAfx/qu5dgKysKPJAO5JzZ/YLbm2oiFG073oI4iUS6ftx02StNz5VJB2dg6YrLHWY8g 5I4NvYLD//TGkIb/rcp+f148XbA3RyKncE+j7lwKmhNSb0eL7f7JRGDZMd882rteqT1l qxulRVyreDG5mBMtOZlBoDSEP0G0ckzTzYspDnEoc4JSOU0cLtnf8oNKL2f8cf1VYQn3 4Ttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iA1CKD9Q; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a621d07000000b0063b60063f55si30308330pfd.382.2023.05.02.01.04.56; Tue, 02 May 2023 01:05:08 -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=@intel.com header.s=Intel header.b=iA1CKD9Q; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233706AbjEBH4N (ORCPT + 99 others); Tue, 2 May 2023 03:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjEBH4L (ORCPT ); Tue, 2 May 2023 03:56:11 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BEF430F9; Tue, 2 May 2023 00:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683014170; x=1714550170; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=nrkr4HYmMNERiR03z1fTM4+8ZBGmodVVyRAkn4iTZe4=; b=iA1CKD9QN/r5BedDyY96UN8tEqmADQ8p/7gWi0GV/hZg/dWYsvbDKHMq 33vb2IpxrE1rAveWR9F7Z1IYquO5t65yUi9FLPwi9LRq3f06Sosy/sqoR a6+HAEYb/2sJC5u5rv4iUAuURiqvgxGYB4nMevSeNFn6gUsl6pxIZMVBF M1jkSVzwLlGtyBRb3TUyT9qHHp32yL9v+hHMAyERpTAN5q+0q8yDFxBHk Xo/es4qt5ZESY7ksYC9Z8pqSYfuuSxyWRlPzg7MjeRsEKnFGtDdb3ZGzd 7rT9sPR44NwgT5PZGYcjIMbeQOX06tmfleBeXBPDeTc99TD6PKVof79XY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="332689690" X-IronPort-AV: E=Sophos;i="5.99,243,1677571200"; d="scan'208";a="332689690" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 00:56:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="807752489" X-IronPort-AV: E=Sophos;i="5.99,243,1677571200"; d="scan'208";a="807752489" Received: from xinpan-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.35.163]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 00:55:50 -0700 From: Jani Nikula To: Suren Baghdasaryan , akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, 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, 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, surenb@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 01/40] lib/string_helpers: Drop space in string_get_size's output In-Reply-To: <20230501165450.15352-2-surenb@google.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230501165450.15352-1-surenb@google.com> <20230501165450.15352-2-surenb@google.com> Date: Tue, 02 May 2023 10:55:47 +0300 Message-ID: <877ctr2mm4.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, 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 Mon, 01 May 2023, Suren Baghdasaryan wrote: > From: Kent Overstreet > > Previously, string_get_size() outputted a space between the number and > the units, i.e. > 9.88 MiB > > This changes it to > 9.88MiB > > which allows it to be parsed correctly by the 'sort -h' command. The former is easier for humans to parse, and that should be preferred. 'sort -h' is supposed to compare "human readable numbers", so arguably sort does not do its job here. BR, Jani. > > Signed-off-by: Kent Overstreet > Signed-off-by: Suren Baghdasaryan > Cc: Andy Shevchenko > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: "Noralf Tr=C3=B8nnes" > Cc: Jens Axboe > --- > lib/string_helpers.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/string_helpers.c b/lib/string_helpers.c > index 230020a2e076..593b29fece32 100644 > --- a/lib/string_helpers.c > +++ b/lib/string_helpers.c > @@ -126,8 +126,7 @@ void string_get_size(u64 size, u64 blk_size, const en= um string_size_units units, > else > unit =3D units_str[units][i]; >=20=20 > - snprintf(buf, len, "%u%s %s", (u32)size, > - tmp, unit); > + snprintf(buf, len, "%u%s%s", (u32)size, tmp, unit); > } > EXPORT_SYMBOL(string_get_size); --=20 Jani Nikula, Intel Open Source Graphics Center