From: James Bottomley Subject: Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap Date: Mon, 25 Jan 2016 12:18:55 -0800 Message-ID: <1453753135.2363.60.camel@HansenPartnership.com> References: <1453560913-134672-1-git-send-email-andriy.shevchenko@linux.intel.com> <1453560913-134672-4-git-send-email-andriy.shevchenko@linux.intel.com> <1453567445.2470.24.camel@HansenPartnership.com> <94D0CD8314A33A4D9D801C0FE68B40295BF3B840@G9W0745.americas.hpqcorp.net> <1453748172.2363.36.camel@HansenPartnership.com> <1453751131.2363.54.camel@HansenPartnership.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andy Shevchenko Cc: "Elliott, Robert (Persistent Memory)" , Andy Shevchenko , Matt Fleming , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Rasmus Villemoes , Andrew Morton , "linux-kernel @ vger . kernel . org" List-Id: linux-efi@vger.kernel.org On Mon, 2016-01-25 at 22:01 +0200, Andy Shevchenko wrote: > On Mon, Jan 25, 2016 at 9:45 PM, James Bottomley > wrote: > > On Mon, 2016-01-25 at 21:28 +0200, Andy Shevchenko wrote: > > > On Mon, Jan 25, 2016 at 8:56 PM, James Bottomley > > > 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. I think that's a bad idea: The range shows you the exact stuff in hex, so all the information is present if you want precision. What's printed in brackets is for humans to read. I'd have to reach for a calculator to work out that 18446744073709551615 is actually around 20 GiB. James