From: Paul M. <pm...@mv...> - 2001-10-05 18:55:57
|
Hello, Just keeping with the trend.. (everyone else is adopting this already).. The attached patch is based off the same change that was done to the PPC code a little bit ago. Regards, --=20 Paul Mundt <pm...@mv...> MontaVista Software, Inc. Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/linuxsh/kernel/ChangeLog,v retrieving revision 1.346 diff -u -r1.346 ChangeLog --- ChangeLog 2001/10/01 06:16:39 1.346 +++ ChangeLog 2001/10/05 18:47:28 @@ -1,3 +1,8 @@ +2001-10-04 Paul Mundt <le...@ch...> + + * arch/sh/mm/fault.c (do_page_fault): Don't kill init when out + of memory. + 2001-10-01 M. R. Brown <mr...@0x...> =20 * drivers/video/pvr2fb.c (pvr2fb_init): Make fb_find_mode() default Index: arch/sh/mm/fault.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/linuxsh/kernel/arch/sh/mm/fault.c,v retrieving revision 1.48 diff -u -r1.48 fault.c --- arch/sh/mm/fault.c 2001/08/09 00:27:04 1.48 +++ arch/sh/mm/fault.c 2001/10/05 18:47:41 @@ -134,6 +134,7 @@ * make sure we exit gracefully rather than endlessly redo * the fault. */ +survive: switch (handle_mm_fault(mm, vma, address, writeaccess)) { case 1: tsk->min_flt++; @@ -205,6 +206,12 @@ */ out_of_memory: up_read(&mm->mmap_sem); + if (current->pid =3D=3D 1) { + current->policy |=3D SCHED_YIELD; + schedule(); + down_read(&mm->mmap_sem); + goto survive; + } printk("VM: killing process %s\n", tsk->comm); if (user_mode(regs)) do_exit(SIGKILL); |