On Tue, 15 Dec 2015 19:36:15 +0100 Michal Hocko <mhocko@xxxxxxxxxx> wrote: > From: Michal Hocko <mhocko@xxxxxxxx> > > This is based on the idea from Mel Gorman discussed during LSFMM 2015 and > independently brought up by Oleg Nesterov. > > The OOM killer currently allows to kill only a single task in a good > hope that the task will terminate in a reasonable time and frees up its > memory. Such a task (oom victim) will get an access to memory reserves > via mark_oom_victim to allow a forward progress should there be a need > for additional memory during exit path. > > ... > > +static void oom_reap_vmas(struct mm_struct *mm) > +{ > + int attempts = 0; > + > + while (attempts++ < 10 && !__oom_reap_vmas(mm)) > + schedule_timeout(HZ/10); schedule_timeout() in state TASK_RUNNING doesn't do anything. Use msleep() or msleep_interruptible(). I can't decide which is more appropriate - it only affects the load average display. Which prompts the obvious question: as the no-operativeness of this call wasn't noticed in testing, why do we have it there... I guess it means that the __oom_reap_vmas() success rate is nice and high ;) -- 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>