2015-04-06 18:05:58

by Toshi Kani

[permalink] [raw]
Subject: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()

'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 <[email protected]>
Signed-off-by: Toshi Kani <[email protected]>
Tested-by: Christoph Hellwig <[email protected]>
---
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;


2015-04-06 18:29:38

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()

On Mon, Apr 6, 2015 at 10:47 AM, Toshi Kani <[email protected]> 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 <[email protected]>
> Signed-off-by: Toshi Kani <[email protected]>
> Tested-by: Christoph Hellwig <[email protected]>
> ---
> 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


Attachments:
revert_end_of_ram_change.patch (1.34 kB)

2015-04-06 18:54:46

by Toshi Kani

[permalink] [raw]
Subject: Re: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()

On Mon, 2015-04-06 at 11:29 -0700, Yinghai Lu wrote:
> On Mon, Apr 6, 2015 at 10:47 AM, Toshi Kani <[email protected]> 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 <[email protected]>
> > Signed-off-by: Toshi Kani <[email protected]>
> > Tested-by: Christoph Hellwig <[email protected]>
> > ---
> > 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.

Will do.

Thanks,
-Toshi