Skip to content

oom: TIF_MEMDIE/PF_EXITING fixes

Oleg Nesterov linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3oom: oom_kill_task: mark every thread as TIF_MEMDIEmm/oom_kill.c+14 -41 reply
1/3oom: oom_kill_process: don't set TIF_MEMDIE if !p->mmmm/oom_kill.c+1 -19 replies
2/3oom: select_bad_process: improve the PF_EXITING checkmm/oom_kill.c+17 -10 replies
2/3oom: select_bad_process: ignore TIF_MEMDIE zombiesmm/oom_kill.c+2 -11 reply
3/3oom: select_bad_process: use same_thread_group()mm/oom_kill.c+1 -10 replies
3/3oom: oom_kill_process: fix the child_points logicmm/oom_kill.c+8 -32 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] oom: TIF_MEMDIE/PF_EXITING fixes
Quoted 40 lines · Oleg Nesterov
Quoted 11 lines · David Rientjes
Quoted 7 lines · Andrew Morton

If Oleg's test program cause a hang with oom-prevent-unnecessary-oom-kills-or-kernel-panics.patch and doesn't cause a hang without oom-prevent-unnecessary-oom-kills-or-kernel-panics.patch then that's a big problem for oom-prevent-unnecessary-oom-kills-or-kernel-panics.patch, no?

Quoted 2 lines

It's a problem, but not because of oom-prevent-unnecessary-oom-kills-or-kernel-panics.patch.

It is, afaics. oom-killer can't ussume that a single PF_EXITING && p->mm thread is going to free the memory.

Quoted 4 lines

If we don't
have this patch, then we have a trivial panic when an oom kill occurs in a cpuset with no other eligible processes, the oom killed thread group leader exits

It is not clear what "leader exits" actually mean. OK, perhaps you mean its ->mm == NULL.

Quoted 3 lines

but its other threads do not and they trigger oom kills themselves. for_each_process() does not iterate over these threads and so it finds no eligible threads to kill and then panics

Could you explain what do you mean? No need to kill these threads, they are already killed, we should wait until they all exit.

Quoted 3 lines

I'll look at Oleg's test case
and see what can be done to fix that condition, but the answer isn't to ignore eligible threads that can be killed.

Once again, they are already killed. Or I do not understand what you meant.

Quoted 7 lines

Could you please explain the problem in more details?

Also. Could you please look at the patches I sent?

[PATCH 1/1] oom_kill_task: mark every thread as TIF_MEMDIE [PATCH v2 1/1] select_bad_process: improve the PF_EXITING check

Cough. And both were not right, while_each_thread(p, t) needs the properly initialized "t". At least I warned they were not tested ;)

Quoted 1 line

Note also the note about "p == current" check. it should be fixed too.

I am resending the fixes above plus the new one.

David, Kosaki, what do you think?

Oleg.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>