Re: /proc/kcore has a unreasonable size(281474974617600) in x86_642.6.30-rc8.

From: Tao Ma
Date: Fri Jun 05 2009 - 10:28:32 EST




Amerigo Wang wrote:
On Fri, Jun 05, 2009 at 05:30:49PM +0800, Tao Ma wrote:
Please send the boot logs: dmesg -s 1000000 > foo
attached.

#######high memory 18446612137615818752, size_t 18446612137615818752
#######kcore size 5301604352, PAGE_OFFSET 0, PAGE_SIZE 4096


These two lines must be added by yourself...

What?!
How can PAGE_OFFSET be 0??
Can you show us these two printk() you just added?

And, the size of kcore is not the crazy number in the subject...
This one is much saner..
Sorry, I used the wrong printk. the correct one is:
#######high memory 18446612137615818752, size_t 18446612137615818752
#######kcore size 5301604352, PAGE_OFFSET 18446612132314218496, PAGE_SIZE 4096

the printk is attached.

Thanks.
Tao
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 59b43a0..50830c7 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -408,6 +408,13 @@ static int __init proc_kcore_init(void)
if (proc_root_kcore)
proc_root_kcore->size =
(size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
+ printk(KERN_INFO "#######high memory %lu, size_t %llu\n",
+ (unsigned long long)high_memory, (size_t)high_memory);
+ if (proc_root_kcore)
+ printk(KERN_INFO "#######kcore size %lu, "
+ "PAGE_OFFSET %lu, PAGE_SIZE %lu\n",
+ proc_root_kcore->size,
+ PAGE_OFFSET, PAGE_SIZE);
return 0;
}
module_init(proc_kcore_init);