aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index d348b9035955..14bd4ec79597 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -274,6 +274,7 @@ void out_of_memory(gfp_t gfp_mask, int order)
274 show_mem(); 274 show_mem();
275 } 275 }
276 276
277 cpuset_lock();
277 read_lock(&tasklist_lock); 278 read_lock(&tasklist_lock);
278retry: 279retry:
279 p = select_bad_process(); 280 p = select_bad_process();
@@ -284,6 +285,7 @@ retry:
284 /* Found nothing?!?! Either we hang forever, or we panic. */ 285 /* Found nothing?!?! Either we hang forever, or we panic. */
285 if (!p) { 286 if (!p) {
286 read_unlock(&tasklist_lock); 287 read_unlock(&tasklist_lock);
288 cpuset_unlock();
287 panic("Out of memory and no killable processes...\n"); 289 panic("Out of memory and no killable processes...\n");
288 } 290 }
289 291
@@ -293,12 +295,14 @@ retry:
293 295
294 out: 296 out:
295 read_unlock(&tasklist_lock); 297 read_unlock(&tasklist_lock);
298 cpuset_unlock();
296 if (mm) 299 if (mm)
297 mmput(mm); 300 mmput(mm);
298 301
299 /* 302 /*
300 * Give "p" a good chance of killing itself before we 303 * Give "p" a good chance of killing itself before we
301 * retry to allocate memory. 304 * retry to allocate memory unless "p" is current
302 */ 305 */
303 schedule_timeout_interruptible(1); 306 if (!test_thread_flag(TIF_MEMDIE))
307 schedule_timeout_interruptible(1);
304} 308}