All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [UML] fix crash in block layer
@ 2007-02-09 22:01 Jason Lunz
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Lunz @ 2007-02-09 22:01 UTC (permalink / raw)
  To: Jeff Dike, Blaisorblade, Jens Axboe; +Cc: user-mode-linux-devel


[resent, axboe@suse.de bounced]

When the device-mapper DM_DEV_CREATE_CMD ioctl is called to create a new
device, dev_create()->dm_create()->alloc_dev()->
blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY) happens.

blk_queue_bounce_limit(BLK_BOUNCE_ANY) calls init_emergency_isa_pool()
if blk_max_pfn < blk_max_low_pfn. This is the case on UML, but
init_emergency_isa_pool() hits BUG_ON(!isa_page_pool) because there
doesn't seem to be a dma zone on UML for mempool_create() to allocate from.

Most architectures seem to have max_low_pfn == max_pfn, but UML doesn't
because of the uml_reserved chunk it keeps for itself. From what I can
see, max_pfn and max_low_pfn don't get much use after the
bootmem-allocator stops being used anyway, except that they initialize
the block layer's blk_max_low_pfn/blk_max_pfn.

With this applied I can use lvm to create logical volumes without
crashing UML.

Signed-off-by: Jason Lunz <lunz@falooley.org>

---
 arch/um/kernel/mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.20-rc5-uml/arch/um/kernel/mem.c
===================================================================
--- linux-2.6.20-rc5-uml.orig/arch/um/kernel/mem.c
+++ linux-2.6.20-rc5-uml/arch/um/kernel/mem.c
@@ -63,7 +63,7 @@
 
 void mem_init(void)
 {
-	max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
+	max_pfn = max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
 
         /* clear the zero-page */
         memset((void *) empty_zero_page, 0, PAGE_SIZE);
@@ -84,7 +84,6 @@
 	totalram_pages += totalhigh_pages;
 #endif
 	num_physpages = totalram_pages;
-	max_pfn = totalram_pages;
 	printk(KERN_INFO "Memory: %luk available\n", 
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10));
 	kmalloc_ok = 1;

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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] 8+ messages in thread
[parent not found: <20070215160001.GA6774@avocado.homenet>]
* [uml-devel] [UML] fix crash in block layer
@ 2007-02-09 21:30 Jason Lunz
  0 siblings, 0 replies; 8+ messages in thread
From: Jason Lunz @ 2007-02-09 21:30 UTC (permalink / raw)
  To: Jeff Dike, Blaisorblade, Jens Axboe; +Cc: user-mode-linux-devel


When the device-mapper DM_DEV_CREATE_CMD ioctl is called to create a new
device, dev_create()->dm_create()->alloc_dev()->
blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY) happens.

blk_queue_bounce_limit(BLK_BOUNCE_ANY) calls init_emergency_isa_pool()
if blk_max_pfn < blk_max_low_pfn. This is the case on UML, but
init_emergency_isa_pool() hits BUG_ON(!isa_page_pool) because there
doesn't seem to be a dma zone on UML for mempool_create() to allocate from.

Most architectures seem to have max_low_pfn == max_pfn, but UML doesn't
because of the uml_reserved chunk it keeps for itself. From what I can
see, max_pfn and max_low_pfn don't get much use after the
bootmem-allocator stops being used anyway, except that they initialize
the block layer's blk_max_low_pfn/blk_max_pfn.

With this applied I can use lvm to create logical volumes without
crashing UML.

Signed-off-by: Jason Lunz <lunz@falooley.org>

---
 arch/um/kernel/mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6.20-rc5-uml/arch/um/kernel/mem.c
===================================================================
--- linux-2.6.20-rc5-uml.orig/arch/um/kernel/mem.c
+++ linux-2.6.20-rc5-uml/arch/um/kernel/mem.c
@@ -63,7 +63,7 @@
 
 void mem_init(void)
 {
-	max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
+	max_pfn = max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT;
 
         /* clear the zero-page */
         memset((void *) empty_zero_page, 0, PAGE_SIZE);
@@ -84,7 +84,6 @@
 	totalram_pages += totalhigh_pages;
 #endif
 	num_physpages = totalram_pages;
-	max_pfn = totalram_pages;
 	printk(KERN_INFO "Memory: %luk available\n", 
 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10));
 	kmalloc_ok = 1;

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2007-02-19 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09 22:01 [uml-devel] [UML] fix crash in block layer Jason Lunz
     [not found] <20070215160001.GA6774@avocado.homenet>
2007-02-15 17:09 ` Jeff Dike
2007-02-15 19:29   ` Blaisorblade
2007-02-16 17:02     ` Jason Lunz
2007-02-16 18:40       ` Jeff Dike
2007-02-19 22:28         ` Blaisorblade
2007-02-16 19:10       ` Blaisorblade
  -- strict thread matches above, loose matches on Subject: below --
2007-02-09 21:30 Jason Lunz

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.