Skip to contentSkip to conversation

UML - Error message improvement

PATCH New Jeff Dike 1 participant 1 message Sep 23, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 UML - Error message improvement

Output a nice error message for people who need mem > 256M but don't increase on the host /proc/sys/vm/max_map_count, telling them to do so.

arch/um/kernel/physmem.c +6 -1
Index: linux-2.6.9-rc2-mm1-orig/arch/um/kernel/physmem.c
===================================================================
@@ -336,9 +336,14 @@
 
 	fd = phys_mapping(phys, &offset);
 	err = os_map_memory((void *) virt, fd, offset, len, r, w, x);
-	if(err)
+	if(err) {
+		if(err == -ENOMEM)
+			printk("try increasing the host's "
+			       "/proc/sys/vm/max_map_count to <physical "
+			       "memory size>/4096\n");
 		panic("map_memory(0x%lx, %d, 0x%llx, %ld, %d, %d, %d) failed, "
 		      "err = %d\n", virt, fd, offset, len, r, w, x, err);
+	}
 }
 
 #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)