Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: Report host OOM more nicely

If UML runs on the host side out of memory, report this
condition more nicely.

Signed-off-by: Richard Weinberger <richard@nod.at>

+15 -1
+15 -1
arch/um/kernel/tlb.c
··· 50 50 .index = 0, \ 51 51 .force = force }) 52 52 53 + static void report_enomem(void) 54 + { 55 + printk(KERN_ERR "UML ran out of memory on the host side! " 56 + "This can happen due to a memory limitation or " 57 + "vm.max_map_count has been reached.\n"); 58 + } 59 + 53 60 static int do_ops(struct host_vm_change *hvc, int end, 54 61 int finished) 55 62 { ··· 87 80 break; 88 81 } 89 82 } 83 + 84 + if (ret == -ENOMEM) 85 + report_enomem(); 90 86 91 87 return ret; 92 88 } ··· 443 433 else if (pte_newprot(*pte)) 444 434 err = protect(mm_id, address, PAGE_SIZE, prot, 1, &flush); 445 435 446 - if (err) 436 + if (err) { 437 + if (err == -ENOMEM) 438 + report_enomem(); 439 + 447 440 goto kill; 441 + } 448 442 449 443 *pte = pte_mkuptodate(*pte); 450 444