瀏覽代碼

nommu: yield CPU while disposing VM

Depending on processor speed, page size, and the amount of memory a
process is allowed to amass, cleanup of a large VM may freeze the system
for many seconds.  This can result in a watchdog timeout.

Make sure other tasks receive some service when cleaning up large VMs.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Steven J. Magnani 14 年之前
父節點
當前提交
04c3496152
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      mm/nommu.c

+ 1 - 0
mm/nommu.c

@@ -1717,6 +1717,7 @@ void exit_mmap(struct mm_struct *mm)
 		mm->mmap = vma->vm_next;
 		mm->mmap = vma->vm_next;
 		delete_vma_from_mm(vma);
 		delete_vma_from_mm(vma);
 		delete_vma(mm, vma);
 		delete_vma(mm, vma);
+		cond_resched();
 	}
 	}
 
 
 	kleave("");
 	kleave("");