From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752905AbcBCKky (ORCPT ); Wed, 3 Feb 2016 05:40:54 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36142 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbcBCKkt (ORCPT ); Wed, 3 Feb 2016 05:40:49 -0500 Date: Wed, 3 Feb 2016 11:40:45 +0100 From: Ingo Molnar To: Laszlo Ersek Cc: Matt Fleming , "H . Peter Anvin" , Thomas Gleixner , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Elliott , Andy Shevchenko , Ard Biesheuvel , Taku Izumi , Linus Torvalds , Andrew Morton Subject: Re: [PATCH 14/14] x86/efi: Print size in binary units in efi_print_memmap Message-ID: <20160203104045.GB7310@gmail.com> References: <1454364428-494-1-git-send-email-matt@codeblueprint.co.uk> <1454364428-494-15-git-send-email-matt@codeblueprint.co.uk> <56B0756E.9010603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B0756E.9010603@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Laszlo Ersek wrote: > I'll take being CC'd as "please offer an opinion", so I'll offer one. :) > > On 02/01/16 23:07, Matt Fleming wrote: > > From: Robert Elliott > > > > Print the size in the best-fit B, KiB, MiB, etc. units rather than > > always MiB. This avoids rounding, which can be misleading. > > > > Use proper IEC binary units (KiB, MiB, etc.) rather than misuse SI > > decimal units (KB, MB, etc.). > > > > old: > > efi: mem61: [Persistent Memory | | | | | | | |WB|WT|WC|UC] range=[0x0000000880000000-0x0000000c7fffffff) (16384MB) > > > > new: > > efi: mem61: [Persistent Memory | | | | | | | |WB|WT|WC|UC] range=[0x0000000880000000-0x0000000c7fffffff] (16 GiB) > > > > Signed-off-by: Robert Elliott > > Signed-off-by: Andy Shevchenko > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: Ard Biesheuvel > > Cc: Taku Izumi > > Cc: Laszlo Ersek > > Signed-off-by: Matt Fleming > > --- > > arch/x86/platform/efi/efi.c | 25 ++++++++++++++++++------- > > 1 file changed, 18 insertions(+), 7 deletions(-) > > > > diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c > > index e80826e6f3a9..2c457c5e8203 100644 > > --- a/arch/x86/platform/efi/efi.c > > +++ b/arch/x86/platform/efi/efi.c > > @@ -35,6 +35,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -117,6 +118,17 @@ void efi_get_time(struct timespec *now) > > now->tv_nsec = 0; > > } > > > > +static char * __init efi_size_format(char *buf, size_t size, u64 bytes) > > +{ > > + static const char *const units_2[] = { > > + "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" > > + }; > > Blech. Blech blech blech. As far as I'm concerned, "IEC binary units" > rewrite history. I propose to just say "KB" & friends. So I kind of agree. Memory is almost never measured in marketing bytes, we should simply output KB/MB/GB/TB/PB/EB like the rest of the memory management code does and ignore all the 'i' silliness that infests storage sizes ... Thanks, Ingo