* [uml-devel] The init_maps bug which cause mem map error
@ 2006-01-10 14:14 wang lianwei
2006-01-10 23:39 ` Blaisorblade
0 siblings, 1 reply; 5+ messages in thread
From: wang lianwei @ 2006-01-10 14:14 UTC (permalink / raw)
To: jdike, user-mode-linux-devel
[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]
There is a bug In file
linux/arch/um/kernel/physmem.c init_mem() functions:
*int* *init_maps*(*unsigned* *long* physmem, *unsigned* *long* iomem,
*unsigned* *long* highmem)
{
*struct* page *p, *map;
*unsigned* *long* phys_len, phys_pages, highmem_len, highmem_pages;
*unsigned* *long* iomem_len, iomem_pages, total_len, total_pages;
*int* i;
phys_pages = physmem >> PAGE_SHIFT;
phys_len = phys_pages * *sizeof*(*struct* page);
iomem_pages = iomem >> PAGE_SHIFT;
iomem_len = iomem_pages * *sizeof*(*struct* page);
highmem_pages = highmem >> PAGE_SHIFT;
highmem_len = highmem_pages * *sizeof*(*struct* page);
total_pages = phys_pages + iomem_pages + highmem_pages;
total_len = phys_len + iomem_pages + highmem_len;
*if*(kmalloc_ok){
map = kmalloc(total_len, GFP_KERNEL);
*if*(map == NULL)
map = vmalloc(total_len);
}
*else* map = alloc_bootmem_low_pages(total_len);
*if*(map == NULL)
*return*(-ENOMEM);
*for*(i = 0; i < total_pages; i++){
p = &map[i];
set_page_count(p, 0);
SetPageReserved(p);
INIT_LIST_HEAD(&p->list);
}
mem_map = map;
max_mapnr = total_pages;
*return*(0);
}
this line should be
total_len = phys_len + iomem_len + highmem_len;
<http://cvs.sourceforge.net/viewcvs.py/user-mode-linux/linux/#dirlist>
[-- Attachment #2: Type: text/html, Size: 2672 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] The init_maps bug which cause mem map error
2006-01-10 14:14 [uml-devel] The init_maps bug which cause mem map error wang lianwei
@ 2006-01-10 23:39 ` Blaisorblade
2006-01-11 16:21 ` Jeff Dike
0 siblings, 1 reply; 5+ messages in thread
From: Blaisorblade @ 2006-01-10 23:39 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: wang lianwei, jdike
On Tuesday 10 January 2006 15:14, wang lianwei wrote:
> There is a bug In file
> linux/arch/um/kernel/physmem.c init_mem() functions:
Yep, right...
> *int* *init_maps*(*unsigned* *long* physmem, *unsigned* *long* iomem,
> *unsigned* *long* highmem)
> {
> *struct* page *p, *map;
> *unsigned* *long* phys_len, phys_pages, highmem_len, highmem_pages;
> *unsigned* *long* iomem_len, iomem_pages, total_len, total_pages;
> *int* i;
(What happened to these bad "*" guys ;-) ? )
> phys_pages = physmem >> PAGE_SHIFT;
> phys_len = phys_pages * *sizeof*(*struct* page);
> iomem_pages = iomem >> PAGE_SHIFT;
> iomem_len = iomem_pages * *sizeof*(*struct* page);
> highmem_pages = highmem >> PAGE_SHIFT;
> highmem_len = highmem_pages * *sizeof*(*struct* page);
> total_pages = phys_pages + iomem_pages + highmem_pages;
> total_len = phys_len + iomem_pages + highmem_len;
> this line should be
That line should be the below one, right (it wasn't clear the line you were
correcting, I later grasped it)? I think you're fully right (and I've never
seen iomem working very well, so I tend to agree).
> total_len = phys_len + iomem_len + highmem_len;
Remember people: never compare apples with bananas (or whatever). Thanks for
the note. It's the first patch on my queue.
> <http://cvs.sourceforge.net/viewcvs.py/user-mode-linux/linux/#dirlist>
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive
http://it.messenger.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] The init_maps bug which cause mem map error
2006-01-11 16:21 ` Jeff Dike
@ 2006-01-11 15:52 ` Blaisorblade
2006-01-12 7:57 ` Jeff Dike
0 siblings, 1 reply; 5+ messages in thread
From: Blaisorblade @ 2006-01-11 15:52 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel, wang lianwei
On Wednesday 11 January 2006 17:21, Jeff Dike wrote:
> On Wed, Jan 11, 2006 at 12:39:59AM +0100, Blaisorblade wrote:
> > On Tuesday 10 January 2006 15:14, wang lianwei wrote:
> > (What happened to these bad "*" guys ;-) ? )
> Yeah, this would have been better expressed as a patch.
> > > total_len = phys_len + iomem_len + highmem_len;
> > Remember people: never compare apples with bananas (or whatever).
> Yup, sometimes I wish we had strongly typed integers...
Yeah :-] ...
I think in Java APIs tend to do almost that... not at that point, but they use
distinct classes for Point and Dimension and Rectangle and whatsoever... and
I even have to study these things.
> > Thanks for
> > the note. It's the first patch on my queue.
> OK, I was going to fix it here, but I'll just let you send it in.
Will be in my next queue flush...
> Does this fix the 2M iomem problem?
Ah, well, he's the reporter of that problem, and he also worked diagnosing
it... compliments!
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive
http://it.messenger.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] The init_maps bug which cause mem map error
2006-01-10 23:39 ` Blaisorblade
@ 2006-01-11 16:21 ` Jeff Dike
2006-01-11 15:52 ` Blaisorblade
0 siblings, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2006-01-11 16:21 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, wang lianwei
On Wed, Jan 11, 2006 at 12:39:59AM +0100, Blaisorblade wrote:
> On Tuesday 10 January 2006 15:14, wang lianwei wrote:
> (What happened to these bad "*" guys ;-) ? )
Yeah, this would have been better expressed as a patch.
> > total_len = phys_len + iomem_len + highmem_len;
>
> Remember people: never compare apples with bananas (or whatever).
Yup, sometimes I wish we had strongly typed integers...
> Thanks for
> the note. It's the first patch on my queue.
OK, I was going to fix it here, but I'll just let you send it in.
Does this fix the 2M iomem problem?
Jeff
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] The init_maps bug which cause mem map error
2006-01-11 15:52 ` Blaisorblade
@ 2006-01-12 7:57 ` Jeff Dike
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2006-01-12 7:57 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, wang lianwei
On Wed, Jan 11, 2006 at 04:52:38PM +0100, Blaisorblade wrote:
> > Yup, sometimes I wish we had strongly typed integers...
>
> Yeah :-] ...
But, a nanosecond later, I think about the insanity of bytes_to_page(),
foo_to_bar(), etc converters that would be needed...
> Ah, well, he's the reporter of that problem, and he also worked diagnosing
> it... compliments!
Indeed, I just wanted to make sure that fixed it.
Jeff
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-01-12 7:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-10 14:14 [uml-devel] The init_maps bug which cause mem map error wang lianwei
2006-01-10 23:39 ` Blaisorblade
2006-01-11 16:21 ` Jeff Dike
2006-01-11 15:52 ` Blaisorblade
2006-01-12 7:57 ` Jeff Dike
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.