* [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()
@ 2015-04-06 17:47 Toshi Kani
2015-04-06 18:29 ` Yinghai Lu
0 siblings, 1 reply; 3+ messages in thread
From: Toshi Kani @ 2015-04-06 17:47 UTC (permalink / raw)
To: mingo, hpa, tglx
Cc: linux-nvdimm, linux-fsdevel, x86, linux-kernel, hch, boaz,
Yinghai Lu, Toshi Kani
'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 <yinghai@kernel.org>
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Tested-by: Christoph Hellwig <hch@lst.de>
---
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()
2015-04-06 17:47 [PATCH] x86: Revert E820_PRAM change in e820_end_pfn() Toshi Kani
@ 2015-04-06 18:29 ` Yinghai Lu
2015-04-06 18:36 ` Toshi Kani
0 siblings, 1 reply; 3+ messages in thread
From: Yinghai Lu @ 2015-04-06 18:29 UTC (permalink / raw)
To: Toshi Kani
Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-nvdimm,
linux-fsdevel, the arch/x86 maintainers,
Linux Kernel Mailing List, Christoph Hellwig, Boaz Harrosh
[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]
On Mon, Apr 6, 2015 at 10:47 AM, Toshi Kani <toshi.kani@hp.com> 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 <yinghai@kernel.org>
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> Tested-by: Christoph Hellwig <hch@lst.de>
> ---
> 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
[-- Attachment #2: revert_end_of_ram_change.patch --]
[-- Type: text/x-patch, Size: 1373 bytes --]
---
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86: Revert E820_PRAM change in e820_end_pfn()
2015-04-06 18:29 ` Yinghai Lu
@ 2015-04-06 18:36 ` Toshi Kani
0 siblings, 0 replies; 3+ messages in thread
From: Toshi Kani @ 2015-04-06 18:36 UTC (permalink / raw)
To: Yinghai Lu
Cc: Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-nvdimm,
linux-fsdevel, the arch/x86 maintainers,
Linux Kernel Mailing List, Christoph Hellwig, Boaz Harrosh
On Mon, 2015-04-06 at 11:29 -0700, Yinghai Lu wrote:
> On Mon, Apr 6, 2015 at 10:47 AM, Toshi Kani <toshi.kani@hp.com> 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 <yinghai@kernel.org>
> > Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> > Tested-by: Christoph Hellwig <hch@lst.de>
> > ---
> > 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-06 18:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 17:47 [PATCH] x86: Revert E820_PRAM change in e820_end_pfn() Toshi Kani
2015-04-06 18:29 ` Yinghai Lu
2015-04-06 18:36 ` Toshi Kani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).