From: Joe Perches Subject: Re: [PATCH] x86, efi: print debug values in Kib not MB Date: Tue, 29 Jul 2014 16:07:35 -0700 Message-ID: <1406675255.12100.22.camel@joe-AO725> References: <1406653761-3884-1-git-send-email-prarit@redhat.com> <20140729222932.GA17481@pd.tnic> <53D82118.6090202@redhat.com> <20140729223603.GC17241@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: David Rientjes Cc: Borislav Petkov , Prarit Bhargava , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lszubowi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Matt Fleming , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-efi@vger.kernel.org On Tue, 2014-07-29 at 15:42 -0700, David Rientjes wrote: > On Wed, 30 Jul 2014, Borislav Petkov wrote: > > > On Tue, Jul 29, 2014 at 06:32:56PM -0400, Prarit Bhargava wrote: > > > and it was best to keep the code simple with a KiB. > > > > You're missing the point - the output doesn't get simple with KiB. Read > > the example I just gave you! > > > > (13893632kiB) is actively *not* helping when one looks at it! > > > > /proc/meminfo must be frustrating then, too. > > If Prarit is going to implement this suggested reverse memparse() then it > would be nice to also have it as a generic function that others can use. Maybe yet another vsprintf extension? Maybe %pH where vartype is one of [hh, h, u, ul, ull] with something like u64 t1 = (u64)*(appropriate cast)vartype; u64 t2 = t1; int index = 0; while ((t1 >>= 10)) { index++; t2 >>= 10; } to output the equivalent of %llu%s, t2, "bkmgtpezy"[index] ala dump_pagetables