Re: [patch -mm 02/18] oom: sacrifice child with highest badness score for parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Reviewers may observe that the previous implementation would iterate
> through the children and attempt to kill each until one was successful and
> then the parent if none were found while the new code simply kills the
> most memory-hogging task or the parent.  Note that the only time
> oom_kill_task() fails, however, is when a child does not have an mm or has
> a /proc/pid/oom_adj of OOM_DISABLE.  badness() returns 0 for both cases,
> so the final oom_kill_task() will always succeed.

probably we need to call has_intersects_mems_allowed() in this loop. likes

        /* Try to sacrifice the worst child first */
        do {
                list_for_each_entry(c, &t->children, sibling) {
                        unsigned long cpoints;

                        if (c->mm == p->mm)
                                continue;
                        if (oom_unkillable(c, mem, nodemask))
                                continue;

                        /* oom_badness() returns 0 if the thread is unkillable */
                        cpoints = oom_badness(c);
                        if (cpoints > victim_points) {
                                victim = c;
                                victim_points = cpoints;
                        }
                }
        } while_each_thread(p, t);


It mean we shouldn't assume parent and child have the same mems_allowed,
perhaps.



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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]