Michal Hocko wrote: > > > > Note that "[PATCH v3] mm,oom: speed up select_bad_process() loop." temporarily > > > > broke oom_task_origin(task) case, for oom_select_bad_process() might select > > > > a task without mm because oom_badness() which checks for mm != NULL will not be > > > > called. > > > > > > How can we have oom_task_origin without mm? The flag is set explicitly > > > while doing swapoff resp. writing to ksm. We clear the flag before > > > exiting. > > > > What if oom_task_origin(task) received SIGKILL, but task was unable to run for > > very long period (e.g. 30 seconds) due to scheduling priority, and the OOM-reaper > > reaped task's mm within a second. Next round of OOM-killer selects the same task > > due to oom_task_origin(task) without doing MMF_OOM_REAPED test. > > Which is actuall the intended behavior. The whole point of > oom_task_origin is to prevent from killing somebody because of > potentially memory hungry operation (e.g. swapoff) and rather kill the > initiator. Is it guaranteed that try_to_unuse() from swapoff is never blocked on memory allocation (e.g. mmput(), wait_on_page_*()) ? If there is possibility of being blocked on memory allocation, it is not safe to wait for oom_task_origin(task) unconditionally forever. -- 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>