* [PATCH V2] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 2:32 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 2:32 UTC (permalink / raw)
To: Matt Fleming
Cc: Luck, Tony, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo,
Xishi Qiu
On 2013/2/5 0:32, Matt Fleming wrote:
> On Tue, 2013-01-29 at 11:52 +0800, Xishi Qiu wrote:
>> On ia64 platform, I set "crashkernel\x1024M-:600M", and dmesg shows 128M-728M
>> memory is reserved for crash kernel. Then "echo c > /proc/sysrq-trigger" to
>> test kdump.
>>
>> When crash kernel booting, efi_init() will aligns the memory address in
>> IA64_GRANULE_SIZE(16M), so 720M-728M memory will be dropped, It means
>> crash kernel only manage 128M-720M memory.
>>
>> But initrd start and end are fixed in boot loader, it is before efi_init(),
>> so initrd size maybe overflow when free_initrd_mem().
>
> [...]
>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index b755ea9..cfdb1eb 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -207,6 +207,17 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> start = PAGE_ALIGN(start);
>> end = end & PAGE_MASK;
>>
>> + /*
>> + * Initrd size is fixed in boot loader, but kernel parameter max_addr
>> + * which aligns in granules is fixed after boot loader, so initrd size
>> + * maybe overflow.
>> + */
>> + if (max_addr != ~0UL) {
>> + end = GRANULEROUNDDOWN(end);
>> + if (start > end)
>> + start = end;
>> + }
>> +
>> if (start < end)
>> printk(KERN_INFO "Freeing initrd memory: %ldkB freed\n", (end - start) >> 10);
>
> I don't think this is the correct fix.
>
> Now, my ia64-fu is weak, but could it be that there's actually a bug in
> efi_init() and that the following patch would be the best way to fix
> this?
>
> ---
>
> diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
> index f034563..8d579f1 100644
> --- a/arch/ia64/kernel/efi.c
> +++ b/arch/ia64/kernel/efi.c
> @@ -482,7 +482,7 @@ efi_init (void)
> if (memcmp(cp, "mem=", 4) = 0) {
> mem_limit = memparse(cp + 4, &cp);
> } else if (memcmp(cp, "max_addr=", 9) = 0) {
> - max_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> + max_addr = GRANULEROUNDUP(memparse(cp + 9, &cp));
> } else if (memcmp(cp, "min_addr=", 9) = 0) {
> min_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> } else {
>
>
Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
I think the following patch would be better.
Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
arch/ia64/mm/init.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..23f2ee3 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ if ((start >> PAGE_SHIFT) >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V2] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 2:32 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 2:32 UTC (permalink / raw)
To: Matt Fleming
Cc: Luck, Tony, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo,
Xishi Qiu
On 2013/2/5 0:32, Matt Fleming wrote:
> On Tue, 2013-01-29 at 11:52 +0800, Xishi Qiu wrote:
>> On ia64 platform, I set "crashkernel=1024M-:600M", and dmesg shows 128M-728M
>> memory is reserved for crash kernel. Then "echo c > /proc/sysrq-trigger" to
>> test kdump.
>>
>> When crash kernel booting, efi_init() will aligns the memory address in
>> IA64_GRANULE_SIZE(16M), so 720M-728M memory will be dropped, It means
>> crash kernel only manage 128M-720M memory.
>>
>> But initrd start and end are fixed in boot loader, it is before efi_init(),
>> so initrd size maybe overflow when free_initrd_mem().
>
> [...]
>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index b755ea9..cfdb1eb 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -207,6 +207,17 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> start = PAGE_ALIGN(start);
>> end = end & PAGE_MASK;
>>
>> + /*
>> + * Initrd size is fixed in boot loader, but kernel parameter max_addr
>> + * which aligns in granules is fixed after boot loader, so initrd size
>> + * maybe overflow.
>> + */
>> + if (max_addr != ~0UL) {
>> + end = GRANULEROUNDDOWN(end);
>> + if (start > end)
>> + start = end;
>> + }
>> +
>> if (start < end)
>> printk(KERN_INFO "Freeing initrd memory: %ldkB freed\n", (end - start) >> 10);
>
> I don't think this is the correct fix.
>
> Now, my ia64-fu is weak, but could it be that there's actually a bug in
> efi_init() and that the following patch would be the best way to fix
> this?
>
> ---
>
> diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
> index f034563..8d579f1 100644
> --- a/arch/ia64/kernel/efi.c
> +++ b/arch/ia64/kernel/efi.c
> @@ -482,7 +482,7 @@ efi_init (void)
> if (memcmp(cp, "mem=", 4) == 0) {
> mem_limit = memparse(cp + 4, &cp);
> } else if (memcmp(cp, "max_addr=", 9) == 0) {
> - max_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> + max_addr = GRANULEROUNDUP(memparse(cp + 9, &cp));
> } else if (memcmp(cp, "min_addr=", 9) == 0) {
> min_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> } else {
>
>
Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
I think the following patch would be better.
Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
arch/ia64/mm/init.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..23f2ee3 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ if ((start >> PAGE_SHIFT) >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V2] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 2:32 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 2:32 UTC (permalink / raw)
To: Matt Fleming
Cc: Luck, Tony, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w, Liujiang,
Andrew Morton, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo,
Xishi Qiu
On 2013/2/5 0:32, Matt Fleming wrote:
> On Tue, 2013-01-29 at 11:52 +0800, Xishi Qiu wrote:
>> On ia64 platform, I set "crashkernel=1024M-:600M", and dmesg shows 128M-728M
>> memory is reserved for crash kernel. Then "echo c > /proc/sysrq-trigger" to
>> test kdump.
>>
>> When crash kernel booting, efi_init() will aligns the memory address in
>> IA64_GRANULE_SIZE(16M), so 720M-728M memory will be dropped, It means
>> crash kernel only manage 128M-720M memory.
>>
>> But initrd start and end are fixed in boot loader, it is before efi_init(),
>> so initrd size maybe overflow when free_initrd_mem().
>
> [...]
>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index b755ea9..cfdb1eb 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -207,6 +207,17 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> start = PAGE_ALIGN(start);
>> end = end & PAGE_MASK;
>>
>> + /*
>> + * Initrd size is fixed in boot loader, but kernel parameter max_addr
>> + * which aligns in granules is fixed after boot loader, so initrd size
>> + * maybe overflow.
>> + */
>> + if (max_addr != ~0UL) {
>> + end = GRANULEROUNDDOWN(end);
>> + if (start > end)
>> + start = end;
>> + }
>> +
>> if (start < end)
>> printk(KERN_INFO "Freeing initrd memory: %ldkB freed\n", (end - start) >> 10);
>
> I don't think this is the correct fix.
>
> Now, my ia64-fu is weak, but could it be that there's actually a bug in
> efi_init() and that the following patch would be the best way to fix
> this?
>
> ---
>
> diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
> index f034563..8d579f1 100644
> --- a/arch/ia64/kernel/efi.c
> +++ b/arch/ia64/kernel/efi.c
> @@ -482,7 +482,7 @@ efi_init (void)
> if (memcmp(cp, "mem=", 4) == 0) {
> mem_limit = memparse(cp + 4, &cp);
> } else if (memcmp(cp, "max_addr=", 9) == 0) {
> - max_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> + max_addr = GRANULEROUNDUP(memparse(cp + 9, &cp));
> } else if (memcmp(cp, "min_addr=", 9) == 0) {
> min_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
> } else {
>
>
Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
I think the following patch would be better.
Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
Signed-off-by: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/ia64/mm/init.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..23f2ee3 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ if ((start >> PAGE_SHIFT) >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 6:09 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 6:09 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton,
linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo,
WuJianguo
> Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
> several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> I think the following patch would be better.
>
> Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..23f2ee3 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + if ((start >> PAGE_SHIFT) >= max_low_pfn)
I confused the vaddr and paddr, really sorry for it.
In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
when freeing initrd memory. There are some pages missed at the end of the seciton.
ChangeLog V3:
fixed vaddr mistake
ChangeLog V2:
add invalid pages check when freeing initrd memory
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
arch/ia64/mm/init.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..8a269f8 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -173,6 +173,7 @@ void __init
free_initrd_mem (unsigned long start, unsigned long end)
{
struct page *page;
+ unsigned long pfn;
/*
* EFI uses 4KB pages while the kernel can use 4KB or bigger.
* Thus EFI and the kernel may have different page sizes. It is
@@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ pfn = __pa(start) >> PAGE_SHIFT;
+ if (pfn >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 6:09 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 6:09 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton,
linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo,
WuJianguo
> Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
> several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> I think the following patch would be better.
>
> Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..23f2ee3 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + if ((start >> PAGE_SHIFT) >= max_low_pfn)
I confused the vaddr and paddr, really sorry for it.
In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel\x1024M-:600M"
and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
when freeing initrd memory. There are some pages missed at the end of the seciton.
ChangeLog V3:
fixed vaddr mistake
ChangeLog V2:
add invalid pages check when freeing initrd memory
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
arch/ia64/mm/init.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..8a269f8 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -173,6 +173,7 @@ void __init
free_initrd_mem (unsigned long start, unsigned long end)
{
struct page *page;
+ unsigned long pfn;
/*
* EFI uses 4KB pages while the kernel can use 4KB or bigger.
* Thus EFI and the kernel may have different page sizes. It is
@@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ pfn = __pa(start) >> PAGE_SHIFT;
+ if (pfn >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 6:09 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 6:09 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton,
linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo,
WuJianguo
> Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
> several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> I think the following patch would be better.
>
> Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..23f2ee3 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + if ((start >> PAGE_SHIFT) >= max_low_pfn)
I confused the vaddr and paddr, really sorry for it.
In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
when freeing initrd memory. There are some pages missed at the end of the seciton.
ChangeLog V3:
fixed vaddr mistake
ChangeLog V2:
add invalid pages check when freeing initrd memory
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
arch/ia64/mm/init.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..8a269f8 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -173,6 +173,7 @@ void __init
free_initrd_mem (unsigned long start, unsigned long end)
{
struct page *page;
+ unsigned long pfn;
/*
* EFI uses 4KB pages while the kernel can use 4KB or bigger.
* Thus EFI and the kernel may have different page sizes. It is
@@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ pfn = __pa(start) >> PAGE_SHIFT;
+ if (pfn >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-07 6:09 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-07 6:09 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, Luck, Tony, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w,
Liujiang, Andrew Morton, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
> Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
> several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> I think the following patch would be better.
>
> Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
>
> Signed-off-by: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> arch/ia64/mm/init.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..23f2ee3 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + if ((start >> PAGE_SHIFT) >= max_low_pfn)
I confused the vaddr and paddr, really sorry for it.
In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
when freeing initrd memory. There are some pages missed at the end of the seciton.
ChangeLog V3:
fixed vaddr mistake
ChangeLog V2:
add invalid pages check when freeing initrd memory
Signed-off-by: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/ia64/mm/init.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383..8a269f8 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -173,6 +173,7 @@ void __init
free_initrd_mem (unsigned long start, unsigned long end)
{
struct page *page;
+ unsigned long pfn;
/*
* EFI uses 4KB pages while the kernel can use 4KB or bigger.
* Thus EFI and the kernel may have different page sizes. It is
@@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start))
continue;
+ pfn = __pa(start) >> PAGE_SHIFT;
+ if (pfn >= max_low_pfn)
+ continue;
page = virt_to_page(start);
ClearPageReserved(page);
init_page_count(page);
--
1.7.6.1
^ permalink raw reply related [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:11 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:11 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Building linux-next today (tag next-20130212) I get the following errors when
building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
sim_defconfig}
arch/ia64/mm/init.c: In function 'free_initrd_mem':
arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
this function)
arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
reported only once
arch/ia64/mm/init.c:215: error: for each function it appears in.)
arch/ia64/mm/init.c:216: error: implicit declaration of function
'GRANULEROUNDDOWN'
with "git blame" saying that these lines in init.c were added/changed by
commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
Author: Xishi Qiu <qiuxishi@huawei.com>
Date: Thu Feb 7 12:25:59 2013 +1100
ia64/mm: fix a bad_page bug when crash kernel booting
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:11 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:11 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Building linux-next today (tag next-20130212) I get the following errors when
building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
sim_defconfig}
arch/ia64/mm/init.c: In function 'free_initrd_mem':
arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
this function)
arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
reported only once
arch/ia64/mm/init.c:215: error: for each function it appears in.)
arch/ia64/mm/init.c:216: error: implicit declaration of function
'GRANULEROUNDDOWN'
with "git blame" saying that these lines in init.c were added/changed by
commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
Author: Xishi Qiu <qiuxishi@huawei.com>
Date: Thu Feb 7 12:25:59 2013 +1100
ia64/mm: fix a bad_page bug when crash kernel booting
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:11 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:11 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Building linux-next today (tag next-20130212) I get the following errors when
building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
sim_defconfig}
arch/ia64/mm/init.c: In function 'free_initrd_mem':
arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
this function)
arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
reported only once
arch/ia64/mm/init.c:215: error: for each function it appears in.)
arch/ia64/mm/init.c:216: error: implicit declaration of function
'GRANULEROUNDDOWN'
with "git blame" saying that these lines in init.c were added/changed by
commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
Author: Xishi Qiu <qiuxishi@huawei.com>
Date: Thu Feb 7 12:25:59 2013 +1100
ia64/mm: fix a bad_page bug when crash kernel booting
-Tony
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:11 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:11 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w, Liujiang,
Andrew Morton, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
Building linux-next today (tag next-20130212) I get the following errors when
building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
sim_defconfig}
arch/ia64/mm/init.c: In function 'free_initrd_mem':
arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
this function)
arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
reported only once
arch/ia64/mm/init.c:215: error: for each function it appears in.)
arch/ia64/mm/init.c:216: error: implicit declaration of function
'GRANULEROUNDDOWN'
with "git blame" saying that these lines in init.c were added/changed by
commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
Author: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Date: Thu Feb 7 12:25:59 2013 +1100
ia64/mm: fix a bad_page bug when crash kernel booting
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:19 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:19 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
> with "git blame" saying that these lines in init.c were added/changed by
>
> commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
> Author: Xishi Qiu <qiuxishi@huawei.com>
> Date: Thu Feb 7 12:25:59 2013 +1100
>
> ia64/mm: fix a bad_page bug when crash kernel booting
>
Presumably this:
--- a/arch/ia64/mm/init.c~ia64-mm-fix-a-bad_page-bug-when-crash-kernel-booting-fix
+++ a/arch/ia64/mm/init.c
@@ -27,6 +27,7 @@
#include <asm/machvec.h>
#include <asm/numa.h>
#include <asm/patch.h>
+#include <asm/meminit.h>
#include <asm/pgalloc.h>
#include <asm/sal.h>
#include <asm/sections.h>
_
But, umm, why am I sitting here trying to maintain an ia64 bugfix and
handling bug reports from the ia64 maintainer? Wanna swap?
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:19 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:19 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
> with "git blame" saying that these lines in init.c were added/changed by
>
> commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
> Author: Xishi Qiu <qiuxishi@huawei.com>
> Date: Thu Feb 7 12:25:59 2013 +1100
>
> ia64/mm: fix a bad_page bug when crash kernel booting
>
Presumably this:
--- a/arch/ia64/mm/init.c~ia64-mm-fix-a-bad_page-bug-when-crash-kernel-booting-fix
+++ a/arch/ia64/mm/init.c
@@ -27,6 +27,7 @@
#include <asm/machvec.h>
#include <asm/numa.h>
#include <asm/patch.h>
+#include <asm/meminit.h>
#include <asm/pgalloc.h>
#include <asm/sal.h>
#include <asm/sections.h>
_
But, umm, why am I sitting here trying to maintain an ia64 bugfix and
handling bug reports from the ia64 maintainer? Wanna swap?
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:19 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:19 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
> with "git blame" saying that these lines in init.c were added/changed by
>
> commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
> Author: Xishi Qiu <qiuxishi@huawei.com>
> Date: Thu Feb 7 12:25:59 2013 +1100
>
> ia64/mm: fix a bad_page bug when crash kernel booting
>
Presumably this:
--- a/arch/ia64/mm/init.c~ia64-mm-fix-a-bad_page-bug-when-crash-kernel-booting-fix
+++ a/arch/ia64/mm/init.c
@@ -27,6 +27,7 @@
#include <asm/machvec.h>
#include <asm/numa.h>
#include <asm/patch.h>
+#include <asm/meminit.h>
#include <asm/pgalloc.h>
#include <asm/sal.h>
#include <asm/sections.h>
_
But, umm, why am I sitting here trying to maintain an ia64 bugfix and
handling bug reports from the ia64 maintainer? Wanna swap?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:19 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:19 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w,
Liujiang, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
> with "git blame" saying that these lines in init.c were added/changed by
>
> commit 5a54b4fb8f554b15c6113e30ca8412b7fe11c62e
> Author: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Date: Thu Feb 7 12:25:59 2013 +1100
>
> ia64/mm: fix a bad_page bug when crash kernel booting
>
Presumably this:
--- a/arch/ia64/mm/init.c~ia64-mm-fix-a-bad_page-bug-when-crash-kernel-booting-fix
+++ a/arch/ia64/mm/init.c
@@ -27,6 +27,7 @@
#include <asm/machvec.h>
#include <asm/numa.h>
#include <asm/patch.h>
+#include <asm/meminit.h>
#include <asm/pgalloc.h>
#include <asm/sal.h>
#include <asm/sections.h>
_
But, umm, why am I sitting here trying to maintain an ia64 bugfix and
handling bug reports from the ia64 maintainer? Wanna swap?
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
2013-02-13 0:19 ` Andrew Morton
(?)
@ 2013-02-13 0:32 ` Tony Luck
-1 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, Feb 12, 2013 at 4:19 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> But, umm, why am I sitting here trying to maintain an ia64 bugfix and
> handling bug reports from the ia64 maintainer? Wanna swap?
That sounds like a plan. I'll look out for a new version with the
missing #include
and less silly global variable names and try to take it before you
pull it into -mm
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:32 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, Feb 12, 2013 at 4:19 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> But, umm, why am I sitting here trying to maintain an ia64 bugfix and
> handling bug reports from the ia64 maintainer? Wanna swap?
That sounds like a plan. I'll look out for a new version with the
missing #include
and less silly global variable names and try to take it before you
pull it into -mm
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:32 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-13 0:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, Feb 12, 2013 at 4:19 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> But, umm, why am I sitting here trying to maintain an ia64 bugfix and
> handling bug reports from the ia64 maintainer? Wanna swap?
That sounds like a plan. I'll look out for a new version with the
missing #include
and less silly global variable names and try to take it before you
pull it into -mm
-Tony
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:22 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:22 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
`max_addr' is an awesomely bad name for a global identifier, btw.
And this:
-static u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
+u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
needlessly exported `mem_limit' and `min_addr' as well. These too are
very poor global identifiers.
Also, Matt suggested an alternative implementation which afaik hasn't
been responded to.
I think I'll just drop the patch.
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:22 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:22 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
`max_addr' is an awesomely bad name for a global identifier, btw.
And this:
-static u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
+u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
needlessly exported `mem_limit' and `min_addr' as well. These too are
very poor global identifiers.
Also, Matt suggested an alternative implementation which afaik hasn't
been responded to.
I think I'll just drop the patch.
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:22 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:22 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu, Liujiang, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck@gmail.com> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
`max_addr' is an awesomely bad name for a global identifier, btw.
And this:
-static u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
+u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
needlessly exported `mem_limit' and `min_addr' as well. These too are
very poor global identifiers.
Also, Matt suggested an alternative implementation which afaik hasn't
been responded to.
I think I'll just drop the patch.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 0:22 ` Andrew Morton
0 siblings, 0 replies; 54+ messages in thread
From: Andrew Morton @ 2013-02-13 0:22 UTC (permalink / raw)
To: Tony Luck
Cc: Xishi Qiu, Matt Fleming, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w,
Liujiang, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
On Tue, 12 Feb 2013 16:11:33 -0800
Tony Luck <tony.luck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Building linux-next today (tag next-20130212) I get the following errors when
> building arch/ia64/configs/{tiger_defconfig, zx1_defconfig, bigsur_defconfig,
> sim_defconfig}
>
> arch/ia64/mm/init.c: In function 'free_initrd_mem':
> arch/ia64/mm/init.c:215: error: 'max_addr' undeclared (first use in
> this function)
> arch/ia64/mm/init.c:215: error: (Each undeclared identifier is
> reported only once
> arch/ia64/mm/init.c:215: error: for each function it appears in.)
> arch/ia64/mm/init.c:216: error: implicit declaration of function
> 'GRANULEROUNDDOWN'
>
`max_addr' is an awesomely bad name for a global identifier, btw.
And this:
-static u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
+u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
needlessly exported `mem_limit' and `min_addr' as well. These too are
very poor global identifiers.
Also, Matt suggested an alternative implementation which afaik hasn't
been responded to.
I think I'll just drop the patch.
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
2013-02-07 6:09 ` Xishi Qiu
(?)
@ 2013-02-13 10:07 ` Matt Fleming
-1 siblings, 0 replies; 54+ messages in thread
From: Matt Fleming @ 2013-02-13 10:07 UTC (permalink / raw)
To: Xishi Qiu
Cc: Luck, Tony, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Thu, 2013-02-07 at 14:09 +0800, Xishi Qiu wrote:
> > Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
>
> > several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> > I think the following patch would be better.
> >
> > Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
> >
> > Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> > ---
> > arch/ia64/mm/init.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> > index 082e383..23f2ee3 100644
> > --- a/arch/ia64/mm/init.c
> > +++ b/arch/ia64/mm/init.c
> > @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> > for (; start < end; start += PAGE_SIZE) {
> > if (!virt_addr_valid(start))
> > continue;
> > + if ((start >> PAGE_SHIFT) >= max_low_pfn)
>
> I confused the vaddr and paddr, really sorry for it.
>
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
> when freeing initrd memory. There are some pages missed at the end of the seciton.
>
> ChangeLog V3:
> fixed vaddr mistake
> ChangeLog V2:
> add invalid pages check when freeing initrd memory
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..8a269f8 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -173,6 +173,7 @@ void __init
> free_initrd_mem (unsigned long start, unsigned long end)
> {
> struct page *page;
> + unsigned long pfn;
> /*
> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
> * Thus EFI and the kernel may have different page sizes. It is
> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + pfn = __pa(start) >> PAGE_SHIFT;
> + if (pfn >= max_low_pfn)
> + continue;
> page = virt_to_page(start);
> ClearPageReserved(page);
> init_page_count(page);
I would have presumed that fixing this bug would involve modifying the
ia64-specific kexec code?
Tony, Fenghua? Any thoughts?
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 10:07 ` Matt Fleming
0 siblings, 0 replies; 54+ messages in thread
From: Matt Fleming @ 2013-02-13 10:07 UTC (permalink / raw)
To: Xishi Qiu
Cc: Luck, Tony, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Thu, 2013-02-07 at 14:09 +0800, Xishi Qiu wrote:
> > Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
>
> > several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> > I think the following patch would be better.
> >
> > Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
> >
> > Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> > ---
> > arch/ia64/mm/init.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> > index 082e383..23f2ee3 100644
> > --- a/arch/ia64/mm/init.c
> > +++ b/arch/ia64/mm/init.c
> > @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> > for (; start < end; start += PAGE_SIZE) {
> > if (!virt_addr_valid(start))
> > continue;
> > + if ((start >> PAGE_SHIFT) >= max_low_pfn)
>
> I confused the vaddr and paddr, really sorry for it.
>
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel\x1024M-:600M"
> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
> when freeing initrd memory. There are some pages missed at the end of the seciton.
>
> ChangeLog V3:
> fixed vaddr mistake
> ChangeLog V2:
> add invalid pages check when freeing initrd memory
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..8a269f8 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -173,6 +173,7 @@ void __init
> free_initrd_mem (unsigned long start, unsigned long end)
> {
> struct page *page;
> + unsigned long pfn;
> /*
> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
> * Thus EFI and the kernel may have different page sizes. It is
> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + pfn = __pa(start) >> PAGE_SHIFT;
> + if (pfn >= max_low_pfn)
> + continue;
> page = virt_to_page(start);
> ClearPageReserved(page);
> init_page_count(page);
I would have presumed that fixing this bug would involve modifying the
ia64-specific kexec code?
Tony, Fenghua? Any thoughts?
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-13 10:07 ` Matt Fleming
0 siblings, 0 replies; 54+ messages in thread
From: Matt Fleming @ 2013-02-13 10:07 UTC (permalink / raw)
To: Xishi Qiu
Cc: Luck, Tony, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On Thu, 2013-02-07 at 14:09 +0800, Xishi Qiu wrote:
> > Sorry, this bug will be happen when use Sparse-Memory(section is valid, but last
>
> > several pages are invalid). If use Flat-Memory, crash kernel will boot successfully.
> > I think the following patch would be better.
> >
> > Hi Andrew, will you just ignore the earlier patch and consider the following one? :>
> >
> > Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> > ---
> > arch/ia64/mm/init.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> > index 082e383..23f2ee3 100644
> > --- a/arch/ia64/mm/init.c
> > +++ b/arch/ia64/mm/init.c
> > @@ -213,6 +213,8 @@ free_initrd_mem (unsigned long start, unsigned long end)
> > for (; start < end; start += PAGE_SIZE) {
> > if (!virt_addr_valid(start))
> > continue;
> > + if ((start >> PAGE_SHIFT) >= max_low_pfn)
>
> I confused the vaddr and paddr, really sorry for it.
>
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
> when freeing initrd memory. There are some pages missed at the end of the seciton.
>
> ChangeLog V3:
> fixed vaddr mistake
> ChangeLog V2:
> add invalid pages check when freeing initrd memory
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
> arch/ia64/mm/init.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
> index 082e383..8a269f8 100644
> --- a/arch/ia64/mm/init.c
> +++ b/arch/ia64/mm/init.c
> @@ -173,6 +173,7 @@ void __init
> free_initrd_mem (unsigned long start, unsigned long end)
> {
> struct page *page;
> + unsigned long pfn;
> /*
> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
> * Thus EFI and the kernel may have different page sizes. It is
> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
> for (; start < end; start += PAGE_SIZE) {
> if (!virt_addr_valid(start))
> continue;
> + pfn = __pa(start) >> PAGE_SHIFT;
> + if (pfn >= max_low_pfn)
> + continue;
> page = virt_to_page(start);
> ClearPageReserved(page);
> init_page_count(page);
I would have presumed that fixing this bug would involve modifying the
ia64-specific kexec code?
Tony, Fenghua? Any thoughts?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-16 1:55 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-16 1:55 UTC (permalink / raw)
To: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton
Cc: linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/13 18:07, Matt Fleming wrote:
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
>> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
>> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
>> when freeing initrd memory. There are some pages missed at the end of the seciton.
>>
>> ChangeLog V3:
>> fixed vaddr mistake
>> ChangeLog V2:
>> add invalid pages check when freeing initrd memory
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>> arch/ia64/mm/init.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index 082e383..8a269f8 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -173,6 +173,7 @@ void __init
>> free_initrd_mem (unsigned long start, unsigned long end)
>> {
>> struct page *page;
>> + unsigned long pfn;
>> /*
>> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
>> * Thus EFI and the kernel may have different page sizes. It is
>> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> for (; start < end; start += PAGE_SIZE) {
>> if (!virt_addr_valid(start))
>> continue;
>> + pfn = __pa(start) >> PAGE_SHIFT;
>> + if (pfn >= max_low_pfn)
>> + continue;
>> page = virt_to_page(start);
>> ClearPageReserved(page);
>> init_page_count(page);
>
> I would have presumed that fixing this bug would involve modifying the
> ia64-specific kexec code?
>
> Tony, Fenghua? Any thoughts?
Hi, I had the Spring Festival a few days ago. Please ignore the earlier
patch and consider the V3 one above.
Thanks,
Xishi Qiu
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-16 1:55 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-16 1:55 UTC (permalink / raw)
To: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton
Cc: linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/13 18:07, Matt Fleming wrote:
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel\x1024M-:600M"
>> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
>> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
>> when freeing initrd memory. There are some pages missed at the end of the seciton.
>>
>> ChangeLog V3:
>> fixed vaddr mistake
>> ChangeLog V2:
>> add invalid pages check when freeing initrd memory
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>> arch/ia64/mm/init.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index 082e383..8a269f8 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -173,6 +173,7 @@ void __init
>> free_initrd_mem (unsigned long start, unsigned long end)
>> {
>> struct page *page;
>> + unsigned long pfn;
>> /*
>> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
>> * Thus EFI and the kernel may have different page sizes. It is
>> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> for (; start < end; start += PAGE_SIZE) {
>> if (!virt_addr_valid(start))
>> continue;
>> + pfn = __pa(start) >> PAGE_SHIFT;
>> + if (pfn >= max_low_pfn)
>> + continue;
>> page = virt_to_page(start);
>> ClearPageReserved(page);
>> init_page_count(page);
>
> I would have presumed that fixing this bug would involve modifying the
> ia64-specific kexec code?
>
> Tony, Fenghua? Any thoughts?
Hi, I had the Spring Festival a few days ago. Please ignore the earlier
patch and consider the V3 one above.
Thanks,
Xishi Qiu
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-16 1:55 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-16 1:55 UTC (permalink / raw)
To: Matt Fleming, Luck, Tony, fenghua.yu, Liujiang, Andrew Morton
Cc: linux-ia64, linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/13 18:07, Matt Fleming wrote:
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
>> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
>> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
>> when freeing initrd memory. There are some pages missed at the end of the seciton.
>>
>> ChangeLog V3:
>> fixed vaddr mistake
>> ChangeLog V2:
>> add invalid pages check when freeing initrd memory
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>> arch/ia64/mm/init.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index 082e383..8a269f8 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -173,6 +173,7 @@ void __init
>> free_initrd_mem (unsigned long start, unsigned long end)
>> {
>> struct page *page;
>> + unsigned long pfn;
>> /*
>> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
>> * Thus EFI and the kernel may have different page sizes. It is
>> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> for (; start < end; start += PAGE_SIZE) {
>> if (!virt_addr_valid(start))
>> continue;
>> + pfn = __pa(start) >> PAGE_SHIFT;
>> + if (pfn >= max_low_pfn)
>> + continue;
>> page = virt_to_page(start);
>> ClearPageReserved(page);
>> init_page_count(page);
>
> I would have presumed that fixing this bug would involve modifying the
> ia64-specific kexec code?
>
> Tony, Fenghua? Any thoughts?
Hi, I had the Spring Festival a few days ago. Please ignore the earlier
patch and consider the V3 one above.
Thanks,
Xishi Qiu
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-16 1:55 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-16 1:55 UTC (permalink / raw)
To: Matt Fleming, Luck, Tony, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w,
Liujiang, Andrew Morton
Cc: linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
On 2013/2/13 18:07, Matt Fleming wrote:
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
>> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M].
>> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages
>> when freeing initrd memory. There are some pages missed at the end of the seciton.
>>
>> ChangeLog V3:
>> fixed vaddr mistake
>> ChangeLog V2:
>> add invalid pages check when freeing initrd memory
>>
>> Signed-off-by: Xishi Qiu <qiuxishi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> ---
>> arch/ia64/mm/init.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
>> index 082e383..8a269f8 100644
>> --- a/arch/ia64/mm/init.c
>> +++ b/arch/ia64/mm/init.c
>> @@ -173,6 +173,7 @@ void __init
>> free_initrd_mem (unsigned long start, unsigned long end)
>> {
>> struct page *page;
>> + unsigned long pfn;
>> /*
>> * EFI uses 4KB pages while the kernel can use 4KB or bigger.
>> * Thus EFI and the kernel may have different page sizes. It is
>> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end)
>> for (; start < end; start += PAGE_SIZE) {
>> if (!virt_addr_valid(start))
>> continue;
>> + pfn = __pa(start) >> PAGE_SHIFT;
>> + if (pfn >= max_low_pfn)
>> + continue;
>> page = virt_to_page(start);
>> ClearPageReserved(page);
>> init_page_count(page);
>
> I would have presumed that fixing this bug would involve modifying the
> ia64-specific kexec code?
>
> Tony, Fenghua? Any thoughts?
Hi, I had the Spring Festival a few days ago. Please ignore the earlier
patch and consider the V3 one above.
Thanks,
Xishi Qiu
^ permalink raw reply [flat|nested] 54+ messages in thread
* RE: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
2013-02-07 6:09 ` Xishi Qiu
(?)
@ 2013-02-19 21:38 ` Luck, Tony
-1 siblings, 0 replies; 54+ messages in thread
From: Luck, Tony @ 2013-02-19 21:38 UTC (permalink / raw)
To: Xishi Qiu
Cc: Fleming, Matt, Yu, Fenghua, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 388 bytes --]
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
Is this where the real problem begins? Should we insist that users provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 54+ messages in thread
* RE: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:38 ` Luck, Tony
0 siblings, 0 replies; 54+ messages in thread
From: Luck, Tony @ 2013-02-19 21:38 UTC (permalink / raw)
To: Xishi Qiu
Cc: Fleming, Matt, Yu, Fenghua, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
PiBJbiBlZmlfaW5pdCgpIG1lbW9yeSBhbGlnbnMgaW4gSUE2NF9HUkFOVUxFX1NJWkUoMTZNKS4g
SWYgc2V0ICJjcmFzaGtlcm5lbD0xMDI0TS06NjAwTSINCg0KSXMgdGhpcyB3aGVyZSB0aGUgcmVh
bCBwcm9ibGVtIGJlZ2lucz8gIFNob3VsZCB3ZSBpbnNpc3QgdGhhdCB1c2VycyBwcm92aWRlIGNy
YXNoa2VybmVsDQpwYXJhbWV0ZXJzIHJvdW5kZWQgdG8gR1JBTlVMRSBib3VuZGFyaWVzPw0KDQot
VG9ueQ0K
^ permalink raw reply [flat|nested] 54+ messages in thread
* RE: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:38 ` Luck, Tony
0 siblings, 0 replies; 54+ messages in thread
From: Luck, Tony @ 2013-02-19 21:38 UTC (permalink / raw)
To: Xishi Qiu
Cc: Fleming, Matt, Yu, Fenghua, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 333 bytes --]
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
Is this where the real problem begins? Should we insist that users provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
N§²æìr¸zǧu©²Æ {\béì¹»\x1c®&Þ)îÆi¢Ø^nr¶Ý¢j$½§$¢¸\x05¢¹¨è§~'.)îÄÃ,yèm¶ÿÃ\f%{±j+ðèצj)Z·
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:56 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-19 21:56 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Foolishly sent an earlier reply from Outlook which appears
to have mangled/lost it. Trying again ...
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
Is this where the real problem begins? Should we insist that users
provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:56 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-19 21:56 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Foolishly sent an earlier reply from Outlook which appears
to have mangled/lost it. Trying again ...
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel\x1024M-:600M"
Is this where the real problem begins? Should we insist that users
provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:56 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-19 21:56 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
Foolishly sent an earlier reply from Outlook which appears
to have mangled/lost it. Trying again ...
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
Is this where the real problem begins? Should we insist that users
provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-19 21:56 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-19 21:56 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu-ral2JQCrhuEAvxtiuMwx3w, Liujiang,
Andrew Morton, linux-ia64-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Hanjun Guo, WuJianguo
Foolishly sent an earlier reply from Outlook which appears
to have mangled/lost it. Trying again ...
> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
Is this where the real problem begins? Should we insist that users
provide crashkernel
parameters rounded to GRANULE boundaries?
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
2013-02-19 21:56 ` Tony Luck
(?)
@ 2013-02-20 1:38 ` Xishi Qiu
-1 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-20 1:38 UTC (permalink / raw)
To: Tony Luck
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/20 5:56, Tony Luck wrote:
> Foolishly sent an earlier reply from Outlook which appears
> to have mangled/lost it. Trying again ...
>
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
>
> Is this where the real problem begins? Should we insist that users
Hi Tony, I think this is the real problem begins and it only appears when use Sparse-Memory.
> provide crashkernel
> parameters rounded to GRANULE boundaries?
>
Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Thanks,
Xishi Qiu
> -Tony
>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-20 1:38 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-20 1:38 UTC (permalink / raw)
To: Tony Luck
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/20 5:56, Tony Luck wrote:
> Foolishly sent an earlier reply from Outlook which appears
> to have mangled/lost it. Trying again ...
>
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel\x1024M-:600M"
>
> Is this where the real problem begins? Should we insist that users
Hi Tony, I think this is the real problem begins and it only appears when use Sparse-Memory.
> provide crashkernel
> parameters rounded to GRANULE boundaries?
>
Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Thanks,
Xishi Qiu
> -Tony
>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-20 1:38 ` Xishi Qiu
0 siblings, 0 replies; 54+ messages in thread
From: Xishi Qiu @ 2013-02-20 1:38 UTC (permalink / raw)
To: Tony Luck
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo
On 2013/2/20 5:56, Tony Luck wrote:
> Foolishly sent an earlier reply from Outlook which appears
> to have mangled/lost it. Trying again ...
>
>> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M"
>
> Is this where the real problem begins? Should we insist that users
Hi Tony, I think this is the real problem begins and it only appears when use Sparse-Memory.
> provide crashkernel
> parameters rounded to GRANULE boundaries?
>
Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Thanks,
Xishi Qiu
> -Tony
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
2013-02-20 1:38 ` Xishi Qiu
(?)
@ 2013-02-21 18:21 ` Tony Luck
-1 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-21 18:21 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo,
linux-arch
On Tue, Feb 19, 2013 at 5:38 PM, Xishi Qiu <qiuxishi@huawei.com> wrote:
> Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Perhaps in Documentation/kdump/kdump.txt (which the crashkernel entry
in kernel-parameters.txt
points at). The ia64 section of kdump.txt notes that the start
address will be rounded up to
a GRANULE boundary, but doesn't talk about restrictions on the size.
I wonder if any other architectures have alignment restrictions on the
addresses in
"crashkernel" parameters? Does x86 like them to be 2MB aligned?
Second question is whether we should check and warn in parse_crashkernel_mem()?
I think the answer is "yes" (since the consequences of getting this
wrong don't show
up till much later, and the errors aren't all that obviously connected
back to the original
mistake). Perhaps each architecture that cares could provide defines:
#define ARCH_CRASH_KERNEL_START_ALIGN (... arch value here ...)
#define ARCH_CRASH_KERNEL_SIZE_ALIGN (... arch value here ...)
[Suggestion provided mostly to provoke somebody to provide a more
elegant solution]
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-21 18:21 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-21 18:21 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo,
linux-arch
On Tue, Feb 19, 2013 at 5:38 PM, Xishi Qiu <qiuxishi@huawei.com> wrote:
> Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Perhaps in Documentation/kdump/kdump.txt (which the crashkernel entry
in kernel-parameters.txt
points at). The ia64 section of kdump.txt notes that the start
address will be rounded up to
a GRANULE boundary, but doesn't talk about restrictions on the size.
I wonder if any other architectures have alignment restrictions on the
addresses in
"crashkernel" parameters? Does x86 like them to be 2MB aligned?
Second question is whether we should check and warn in parse_crashkernel_mem()?
I think the answer is "yes" (since the consequences of getting this
wrong don't show
up till much later, and the errors aren't all that obviously connected
back to the original
mistake). Perhaps each architecture that cares could provide defines:
#define ARCH_CRASH_KERNEL_START_ALIGN (... arch value here ...)
#define ARCH_CRASH_KERNEL_SIZE_ALIGN (... arch value here ...)
[Suggestion provided mostly to provoke somebody to provide a more
elegant solution]
-Tony
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting
@ 2013-02-21 18:21 ` Tony Luck
0 siblings, 0 replies; 54+ messages in thread
From: Tony Luck @ 2013-02-21 18:21 UTC (permalink / raw)
To: Xishi Qiu
Cc: Matt Fleming, fenghua.yu, Liujiang, Andrew Morton, linux-ia64,
linux-kernel, linux-efi, linux-mm, Hanjun Guo, WuJianguo,
linux-arch
On Tue, Feb 19, 2013 at 5:38 PM, Xishi Qiu <qiuxishi@huawei.com> wrote:
> Seems like a good idea, should we modify "\linux\Documentation\kernel-parameters.txt"?
Perhaps in Documentation/kdump/kdump.txt (which the crashkernel entry
in kernel-parameters.txt
points at). The ia64 section of kdump.txt notes that the start
address will be rounded up to
a GRANULE boundary, but doesn't talk about restrictions on the size.
I wonder if any other architectures have alignment restrictions on the
addresses in
"crashkernel" parameters? Does x86 like them to be 2MB aligned?
Second question is whether we should check and warn in parse_crashkernel_mem()?
I think the answer is "yes" (since the consequences of getting this
wrong don't show
up till much later, and the errors aren't all that obviously connected
back to the original
mistake). Perhaps each architecture that cares could provide defines:
#define ARCH_CRASH_KERNEL_START_ALIGN (... arch value here ...)
#define ARCH_CRASH_KERNEL_SIZE_ALIGN (... arch value here ...)
[Suggestion provided mostly to provoke somebody to provide a more
elegant solution]
-Tony
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 54+ messages in thread