lkml.org 
[lkml]   [2016]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap
Date


---
Robert Elliott, HPE Persistent Memory


> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko@gmail.com]
> Sent: Monday, January 25, 2016 2:01 PM
> To: James Bottomley <James.Bottomley@hansenpartnership.com>
> Cc: Elliott, Robert (Persistent Memory) <elliott@hpe.com>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; Matt Fleming
> <matt@codeblueprint.co.uk>; Thomas Gleixner <tglx@linutronix.de>; Ingo
> Molnar <mingo@redhat.com>; H . Peter Anvin <hpa@zytor.com>; linux-
> efi@vger.kernel.org; Rasmus Villemoes <linux@rasmusvillemoes.dk>; Andrew
> Morton <akpm@linux-foundation.org>; linux-kernel @ vger . kernel . org
> <linux-kernel@vger.kernel.org>
> Subject: Re: [PATCH v3 3/4] x86/efi: print size in binary units in
> efi_print_memmap
>
> On Mon, Jan 25, 2016 at 9:45 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > On Mon, 2016-01-25 at 21:28 +0200, Andy Shevchenko wrote:
> >> On Mon, Jan 25, 2016 at 8:56 PM, James Bottomley
> >> <James.Bottomley@hansenpartnership.com> wrote:
> >> > On Mon, 2016-01-25 at 18:02 +0000, Elliott, Robert (Persistent
> >> > Memory)
> >> > wrote:
> >>
> >> > Using ffs leads to precision runaway
> >>
> >> How exactly?!
> >
> > Off by one. A size of 0xffffffffffffffff prints 18446744073709551615 B
> > rather than 20 GiB.
>
> Because it's not a 20 GiB. It's exactly 20 GiB - 1 B.
>
> AFAIU, the intention was to show _exact_ size.

For the UEFI memory map, that was indeed my intention. I
don't want it silently round to "20 GiB". Even rounding
to "19.999 GiB" is imprecise.

Another option could be to use a "~" prefix for imperfect
values, like "~20 GiB". That would serve as a warning
that something's not quite right.


\
 
 \ /
  Last update: 2016-01-25 21:41    [W:0.087 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site