Re: [PATCH] mm,oom: Exclude TIF_MEMDIE processes from candidates.

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

 



Michal Hocko wrote:
> I do not think the placement in find_lock_task_mm is desirable nor
> correct. This function is used in multiple contexts outside of the oom
> proper. It only returns a locked task_struct for a thread that belongs
> to the process.

OK. Andrew, please drop from -mm tree for now.

> What you are seeing is clearly undesirable of course but I believe we
> should handle it at oom_kill_process layer. Blindly selecting a child
> process even when it doesn't sit on some memory or when it has already
> been killed is wrong. The heuristic is clearly too naive and so we
> should touch it rather than compensating it somewhere else. What about
> the following simple approach? It does two things and I will split it
> up if this looks like a desirable approach. Please note I haven't tested
> it because it is more of an idea than a finished thing. What do you think?

I think we need to filter at select_bad_process() and oom_kill_process().

When P has no children, P is chosen and TIF_MEMDIE is set on P. But P can
be chosen forever due to P->signal->oom_score_adj == OOM_SCORE_ADJ_MAX
even if the OOM reaper reclaimed P's mm. We need to ensure that
oom_kill_process() is not called with P if P already has TIF_MEMDIE.

(By the way, we are already assuming the OOM reaper kernel thread is
available. Changing to BUG_ON(IS_ERR(oom_reaper_th)) should be OK. ;-) )

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  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]