From patchwork Mon Apr 6 18:29:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 6163651 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC2649F2EC for ; Mon, 6 Apr 2015 18:29:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E32A920340 for ; Mon, 6 Apr 2015 18:29:39 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F074820303 for ; Mon, 6 Apr 2015 18:29:38 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E52AB80FFB; Mon, 6 Apr 2015 11:29:38 -0700 (PDT) X-Original-To: linux-nvdimm@ml01.01.org Delivered-To: linux-nvdimm@ml01.01.org Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3CBC680DBD for ; Mon, 6 Apr 2015 11:29:37 -0700 (PDT) Received: by igblo3 with SMTP id lo3so27942530igb.1 for ; Mon, 06 Apr 2015 11:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=JhGoVzAaqOgP2wzgshE5ndon59ZNAUU3sLZFKTf0Hx0=; b=VPkWdD8/sXLdSrubTNww2AK4Ov3r3pmPXnFMiy2+2nU9oVjfRjroL2Mypyr0/DAGGl RohiYThts2sEUXyunABK0sOoz1n88dmQwLV9asiel9iF9xH7vZ3wkYW+YTNIlr9sNdCZ OUfbNft947cZpezCH4Zmz/ET/ZI68u5TYCSvz+z5nygrXcZOwXuz48DYAGs9ndrRc/BR 1Re5HYx8+BSWJ0Y4LKeSXGTHkm4fLKYUx73qt4vW/88pLPu3pcfpuLEqt9BQEu9rXEur M5akut5gEYaarVdPRb0oiNc6EFR4FNjjvqJEIkIODvzWxOlLSaAJevsnd2p12vj236Am polA== MIME-Version: 1.0 X-Received: by 10.107.15.129 with SMTP id 1mr24695537iop.20.1428344976539; Mon, 06 Apr 2015 11:29:36 -0700 (PDT) Received: by 10.64.208.43 with HTTP; Mon, 6 Apr 2015 11:29:36 -0700 (PDT) In-Reply-To: <1428342439-31285-1-git-send-email-toshi.kani@hp.com> References: <1428342439-31285-1-git-send-email-toshi.kani@hp.com> Date: Mon, 6 Apr 2015 11:29:36 -0700 X-Google-Sender-Auth: jtk2rX8ybPugikhCykzPUVMsTP4 Message-ID: From: Yinghai Lu To: Toshi Kani Cc: linux-nvdimm@ml01.01.org, the arch/x86 maintainers , Linux Kernel Mailing List , Ingo Molnar , "H. Peter Anvin" , linux-fsdevel@vger.kernel.org, Thomas Gleixner , Christoph Hellwig Subject: Re: [Linux-nvdimm] [PATCH] x86: Revert E820_PRAM change in e820_end_pfn() X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Apr 6, 2015 at 10:47 AM, 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. Revert the change made to account > E820_PRAM as RAM in e820_end_pfn() 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 | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c > index e2ce85d..4dfe4bd 100644 > --- a/arch/x86/kernel/e820.c > +++ b/arch/x86/kernel/e820.c > @@ -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 != E820_RAM) > continue; > > start_pfn = ei->addr >> PAGE_SHIFT; Please use attached for code change. Thanks Yinghai --- arch/x86/kernel/e820.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) Index: linux-2.6/arch/x86/kernel/e820.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/e820.c +++ linux-2.6/arch/x86/kernel/e820.c @@ -752,7 +752,7 @@ u64 __init early_reserve_e820(u64 size, /* * 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) { int i; unsigned long last_pfn = 0; @@ -763,11 +763,7 @@ static unsigned long __init e820_end_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 __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)