[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160203104045.GB7310@gmail.com>
Date: Wed, 3 Feb 2016 11:40:45 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Laszlo Ersek <lersek@...hat.com>
Cc: Matt Fleming <matt@...eblueprint.co.uk>,
"H . Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
Robert Elliott <elliott@....com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Taku Izumi <izumi.taku@...fujitsu.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 14/14] x86/efi: Print size in binary units in
efi_print_memmap
* Laszlo Ersek <lersek@...hat.com> 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 <elliott@....com>
> >
> > 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 <elliott@....com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Ingo Molnar <mingo@...nel.org>
> > Cc: "H. Peter Anvin" <hpa@...or.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> > Cc: Taku Izumi <izumi.taku@...fujitsu.com>
> > Cc: Laszlo Ersek <lersek@...hat.com>
> > Signed-off-by: Matt Fleming <matt@...eblueprint.co.uk>
> > ---
> > 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 <linux/efi.h>
> > #include <linux/efi-bgrt.h>
> > #include <linux/export.h>
> > +#include <linux/bitops.h>
> > #include <linux/bootmem.h>
> > #include <linux/slab.h>
> > #include <linux/memblock.h>
> > @@ -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
Powered by blists - more mailing lists