Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751765AbbDGGgn (ORCPT ); Tue, 7 Apr 2015 02:36:43 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:32853 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbbDGGgl (ORCPT ); Tue, 7 Apr 2015 02:36:41 -0400 Message-ID: <55237AF5.3050005@plexistor.com> Date: Tue, 07 Apr 2015 09:36:37 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Toshi Kani , mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de CC: linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, hch@lst.de, Yinghai Lu Subject: Re: [PATCH v2] x86: Revert E820_PRAM change in e820_end_pfn() References: <1428346839-11997-1-git-send-email-toshi.kani@hp.com> In-Reply-To: <1428346839-11997-1-git-send-email-toshi.kani@hp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2765 Lines: 85 On 04/06/2015 10:00 PM, Toshi Kani wrote: > 'Commit ec776ef6bbe17 ("x86/mm: Add support for the non-standard > protected e820 type")' added E820_PRAM ranges, which do not have > have struct-page. Therefore, there is no need to update max_pfn > to cover the E820_PRAM ranges. But E820_PRAM ranges will have the possibility for struct-page. That said I have tested with this patch + struct-page and Tested-by: Boaz Harrosh Comments below ... > Revert the change made to account > E820_PRAM as RAM in e820.c in the commit. > > Signed-off-by: Yinghai Lu > Signed-off-by: Toshi Kani > Tested-by: Christoph Hellwig > --- > The patch is based on the tip branch. > --- > arch/x86/kernel/e820.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c > index e2ce85d..e09a346 100644 > --- a/arch/x86/kernel/e820.c > +++ b/arch/x86/kernel/e820.c > @@ -752,7 +752,7 @@ u64 __init early_reserve_e820(u64 size, u64 align) > /* > * Find the highest page frame number we have available > */ > -static unsigned long __init e820_end_pfn(unsigned long limit_pfn) > +static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) Why don't you rename it to say e820_max_ram_pfn or something with ram as you noted, and drop the @type. As Christoph said it is very ugly. You do not put an extra parameter because of a bad name? Anyway you are changing all call sites so it will not even be a bigger change > { > int i; > unsigned long last_pfn = 0; > @@ -763,11 +763,7 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn) > unsigned long start_pfn; > unsigned long end_pfn; > > - /* > - * Persistent memory is accounted as ram for purposes of > - * establishing max_pfn and mem_map. > - */ > - if (ei->type != E820_RAM && ei->type != E820_PRAM) > + if (ei->type != type) > continue; > > start_pfn = ei->addr >> PAGE_SHIFT; > @@ -792,12 +788,12 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn) > } > unsigned long __init e820_end_of_ram_pfn(void) > { > - return e820_end_pfn(MAX_ARCH_PFN); > + return e820_end_pfn(MAX_ARCH_PFN, E820_RAM); > } > > unsigned long __init e820_end_of_low_ram_pfn(void) > { > - return e820_end_pfn(1UL << (32-PAGE_SHIFT)); > + return e820_end_pfn(1UL<<(32 - PAGE_SHIFT), E820_RAM); > } > > static void early_panic(char *msg) > Thanks Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/