Thread (55 messages) 55 messages, 8 authors, 2012-11-01

Re: zram OOM behavior

From: Sonny Rao <hidden>
Date: 2012-10-30 22:38:13

On Tue, Oct 30, 2012 at 1:30 PM, Luigi Semenzato [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Tue, Oct 30, 2012 at 12:12 PM, Luigi Semenzato [off-list ref] wrote:
quoted
OK, now someone is going to fix this, right? :-)
Actually, there is a very simple fix:
@@ -355,14 +364,6 @@ static struct task_struct
*select_bad_process(unsigned int *ppoints,
                        if (p == current) {
                                chosen = p;
                                *ppoints = 1000;
-                       } else if (!force_kill) {
-                               /*
-                                * If this task is not being ptraced on exit,
-                                * then wait for it to finish before killing
-                                * some other task unnecessarily.
-                                */
-                               if (!(p->group_leader->ptrace & PT_TRACE_EXIT))
-                                       return ERR_PTR(-1UL);
                        }
                }

I'd rather kill some other task unnecessarily than hang!  My load
works fine with this change.
It also appears that we didn't kill any unnecessary tasks either.

It's just a deadlock
exiting process A encounters a page fault and has to allocate some
memory and goes to sleep
process B which is running the OOM Killer blocks on exiting process
and process A blocks forever on memory while process B blocks on A,
and therefore no memory is released

IMO, the fact that we don't do this when the process is being ptraced
also seems to justify that it's a valid thing to do in all cases.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help