Skip to contentSkip to conversation

prevent from killing OOM disabled task in do_page_fault()

RFC PATCH In review Akinobu Mita 3 participants 5 messages Aug 23, 2006 – Aug 24, 2006

Subsystems (9)
Memory management PowerPC MIPS s390 +5 more subsystems
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 prevent from killing OOM disabled task in do_page_fault()

The process protected from oom-killer may be killed when do_page_fault() runs out of memory. This patch skips those processes as well as init task.

I couldn't touch several architectures (arm cris frv parisc sparc sparc64). Because there is no survival path in that case for now.

 arch/alpha/mm/fault.c   |    2 +-
 arch/arm26/mm/fault.c   |    2 +-
 arch/i386/mm/fault.c    |    2 +-
 arch/ia64/mm/fault.c    |    2 +-
 arch/m32r/mm/fault.c    |    2 +-
 arch/m68k/mm/fault.c    |    2 +-
 arch/mips/mm/fault.c    |    2 +-
 arch/powerpc/mm/fault.c |    2 +-
 arch/ppc/mm/fault.c     |    2 +-
 arch/s390/mm/fault.c    |    2 +-
 arch/sh/mm/fault.c      |    2 +-
 arch/sh64/mm/fault.c    |    2 +-
 arch/x86_64/mm/fault.c  |    2 +-
 arch/xtensa/mm/fault.c  |    2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)
arch/alpha/mm/fault.c +1 -1
Index: work-failmalloc/arch/alpha/mm/fault.c
===================================================================
@@ -193,7 +193,7 @@ do_page_fault(unsigned long address, uns
 	/* We ran out of memory, or some other thing happened to us that
 	   made us unable to handle the page fault gracefully.  */
  out_of_memory:
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/arm26/mm/fault.c +1 -1
Index: work-failmalloc/arch/arm26/mm/fault.c
===================================================================
@@ -185,7 +185,7 @@ survive:
 	}
 
 	fault = -3; /* out of memory */
-	if (tsk->pid != 1)
+	if (tsk->pid != 1 && tsk->oomkilladj != OOM_DISABLE)
 		goto out;
 
 	/*
arch/i386/mm/fault.c +1 -1
Index: work-failmalloc/arch/i386/mm/fault.c
===================================================================
@@ -598,7 +598,7 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (tsk->pid == 1) {
+	if (tsk->pid == 1 || tsk->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/ia64/mm/fault.c +1 -1
Index: work-failmalloc/arch/ia64/mm/fault.c
===================================================================
@@ -278,7 +278,7 @@ ia64_do_page_fault (unsigned long addres
 
   out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/m32r/mm/fault.c +1 -1
Index: work-failmalloc/arch/m32r/mm/fault.c
===================================================================
@@ -299,7 +299,7 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (tsk->pid == 1) {
+	if (tsk->pid == 1 || tsk->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/m68k/mm/fault.c +1 -1
Index: work-failmalloc/arch/m68k/mm/fault.c
===================================================================
@@ -181,7 +181,7 @@ good_area:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/mips/mm/fault.c +1 -1
Index: work-failmalloc/arch/mips/mm/fault.c
===================================================================
@@ -171,7 +171,7 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (tsk->pid == 1) {
+	if (tsk->pid == 1 || tsk->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/powerpc/mm/fault.c +1 -1
Index: work-failmalloc/arch/powerpc/mm/fault.c
===================================================================
@@ -386,7 +386,7 @@ bad_area_nosemaphore:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/ppc/mm/fault.c +1 -1
Index: work-failmalloc/arch/ppc/mm/fault.c
===================================================================
@@ -291,7 +291,7 @@ bad_area:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/s390/mm/fault.c +1 -1
Index: work-failmalloc/arch/s390/mm/fault.c
===================================================================
@@ -315,7 +315,7 @@ no_context:
 */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (tsk->pid == 1) {
+	if (tsk->pid == 1 || tsk->oomkilladj == OOM_DISABLE) {
 		yield();
 		goto survive;
 	}
arch/sh/mm/fault.c +1 -1
Index: work-failmalloc/arch/sh/mm/fault.c
===================================================================
@@ -160,7 +160,7 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/sh64/mm/fault.c +1 -1
Index: work-failmalloc/arch/sh64/mm/fault.c
===================================================================
@@ -326,7 +326,7 @@ out_of_memory:
 	}
 	printk("fault:Out of memory\n");
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;
arch/x86_64/mm/fault.c +1 -1
Index: work-failmalloc/arch/x86_64/mm/fault.c
===================================================================
@@ -586,7 +586,7 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) { 
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		goto again;
 	}
arch/xtensa/mm/fault.c +1 -1
Index: work-failmalloc/arch/xtensa/mm/fault.c
===================================================================
@@ -144,7 +144,7 @@ bad_area:
 	 */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (current->pid == 1) {
+	if (current->pid == 1 || current->oomkilladj == OOM_DISABLE) {
 		yield();
 		down_read(&mm->mmap_sem);
 		goto survive;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw

Hi,

Quoted 2 lines

The process protected from oom-killer may be killed when do_page_fault() runs out of memory. This patch skips those processes as well as init task.

Do we have any patch set to disable OOM all together for linux kernel 2.6.13?

Regards and anticipation,
Abu.

#2 lore raw

Ar Iau, 2006-08-24 am 15:43 +0530, ysgrifennodd Abu M. Muttalib:

Quoted 7 lines

Hi,

Quoted 2 lines

The process protected from oom-killer may be killed when do_page_fault() runs out of memory. This patch skips those processes as well as init task.

Do we have any patch set to disable OOM all together for linux kernel 2.6.13?

No, its run tme configurable as is selection priority of the processes which you want killed, has been for some time.

Alan

#3 lore raw

RE: [RFC PATCH] prevent from killing OOM disabled task indo_page_fault()

Hi,

Quoted 1 line
Quoted 1 line
Quoted 1 line

The process protected from oom-killer may be killed when

do_page_fault()

Quoted 1 line
Quoted 1 line
Quoted 1 line

runs out of memory. This patch skips those processes as well as init

task.

Quoted 6 lines
Quoted 3 lines

Do we have any patch set to disable OOM all together for linux kernel 2.6.13?

No, its run tme configurable as is selection priority of the processes which you want killed, has been for some time.

Will you please elaborate upon your reply.

Thanks,
Abu.

#4 lore raw

RE: [RFC PATCH] prevent from killing OOM disabled task indo_page_fault()

Ar Iau, 2006-08-24 am 17:14 +0530, ysgrifennodd Abu M. Muttalib:

Quoted 4 lines
Quoted 2 lines

No, its run tme configurable as is selection priority of the processes which you want killed, has been for some time.

Will you please elaborate upon your reply.

See
Documentation/sysctl/vm.txt Documenation/filesystems/proc.txt (look for oom_adj)

in 2.6.18-rc

Alan