No logic changes, but imho easier to read.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
do_posix_clock_monotonic_gettime(&uptime);
do_each_thread(g, p) {
unsigned long points;
do_posix_clock_monotonic_gettime(&uptime);
do_each_thread(g, p) {
unsigned long points;
/*
* skip kernel threads and tasks which have already released
/*
* skip kernel threads and tasks which have already released
* the process of exiting and releasing its resources.
* Otherwise we could get an OOM deadlock.
*/
* the process of exiting and releasing its resources.
* Otherwise we could get an OOM deadlock.
*/
- releasing = test_tsk_thread_flag(p, TIF_MEMDIE) ||
- p->flags & PF_EXITING;
- if (releasing) {
- if (p->flags & PF_EXITING && p == current) {
- chosen = p;
- *ppoints = ULONG_MAX;
- break;
- }
- return ERR_PTR(-1UL);
+ if ((p->flags & PF_EXITING) && p == current) {
+ chosen = p;
+ *ppoints = ULONG_MAX;
+ break;
+ if ((p->flags & PF_EXITING) ||
+ test_tsk_thread_flag(p, TIF_MEMDIE))
+ return ERR_PTR(-1UL);
+
if (p->oomkilladj == OOM_DISABLE)
continue;
if (p->oomkilladj == OOM_DISABLE)
continue;
*ppoints = points;
}
} while_each_thread(g, p);
*ppoints = points;
}
} while_each_thread(g, p);