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: 6163671 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 55506BF4A6 for ; Mon, 6 Apr 2015 18:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A08A920340 for ; Mon, 6 Apr 2015 18:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D912C20303 for ; Mon, 6 Apr 2015 18:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751AbbDFS3h (ORCPT ); Mon, 6 Apr 2015 14:29:37 -0400 Received: from mail-ig0-f172.google.com ([209.85.213.172]:34699 "EHLO mail-ig0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbbDFS3h (ORCPT ); Mon, 6 Apr 2015 14:29:37 -0400 Received: by iget9 with SMTP id t9so5915556ige.1; 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: Subject: Re: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn() From: Yinghai Lu To: Toshi Kani Cc: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , linux-nvdimm@ml01.01.org, linux-fsdevel@vger.kernel.org, "the arch/x86 maintainers" , Linux Kernel Mailing List , Christoph Hellwig , Boaz Harrosh Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable 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)