From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Subject: Re: [PATCH 08/35] x86,lmb: Add lmb_reserve_area/lmb_free_area Date: Thu, 13 May 2010 23:30:59 -0700 Message-ID: <4BECEE23.3080904@oracle.com> References: <1273796396-29649-1-git-send-email-yinghai@kernel.org> <1273796396-29649-9-git-send-email-yinghai@kernel.org> <1273803964.21352.380.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from rcsinet10.oracle.com ([148.87.113.121]:59391 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755650Ab0ENGdX (ORCPT ); Fri, 14 May 2010 02:33:23 -0400 In-Reply-To: <1273803964.21352.380.camel@pasglop> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Benjamin Herrenschmidt Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , David Miller , Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org On 05/13/2010 07:26 PM, Benjamin Herrenschmidt wrote: > On Thu, 2010-05-13 at 17:19 -0700, Yinghai Lu wrote: > >> #endif >> diff --git a/arch/x86/mm/lmb.c b/arch/x86/mm/lmb.c >> index 37a05e2..0dbe05b 100644 >> --- a/arch/x86/mm/lmb.c >> +++ b/arch/x86/mm/lmb.c >> @@ -117,3 +117,30 @@ void __init lmb_to_bootmem(u64 start, u64 end) >> lmb.reserved.cnt = 0; >> } >> #endif >> + >> +void __init lmb_add_memory(u64 start, u64 end) >> +{ >> + lmb_add_region(&lmb.memory, start, end - start); >> +} > > I completely fail the point of doing such a minor argument conversion > as an exported function, with a naming that would cause certain > confusion with the existing lmb_add(). > > In any case, the above should be done at the call sites. Just call > lmb_add(start, end-start). You also aren't consistent since you do the > similar conversion using the _area suffix below, but not above. > >> +void __init lmb_reserve_area(u64 start, u64 end, char *name) >> +{ >> + if (start == end) >> + return; >> + >> + if (WARN_ONCE(start > end, "lmb_reserve_area: wrong range [%#llx, %#llx]\n", start, end)) >> + return; >> + >> + lmb_add_region(&lmb.reserved, start, end - start); >> +} > > You seem to be fond of gratuituous bloat... > >> +void __init lmb_free_area(u64 start, u64 end) >> +{ >> + if (start == end) >> + return; >> + >> + if (WARN_ONCE(start > end, "lmb_free_area: wrong range [%#llx, %#llx]\n", start, end)) >> + return; >> + >> + lmb_free(start, end - start); >> +} > > And here again. > > If you -really- think there's value in the prototype conversions, then > make those _area() variants static inlines, group the well together in > the .h with a clear explanation saying something like "it's more > practical for some arch to use start/end rather than start/size". > > I personally don't see why you are doing that tho. make the rebase more easy. previous version is using those api. also will add some debug print out with them