On Sat 19-09-15 16:05:12, Tetsuo Handa wrote: > Well, this seems to be a problem which prevents me from testing various > patches that tries to address OOM livelock problem. > > ---------- rcu-stall.c start ---------- > #define _GNU_SOURCE > #include <stdio.h> > #include <stdlib.h> > #include <unistd.h> > #include <sys/types.h> > #include <sys/stat.h> > #include <fcntl.h> > #include <sched.h> > > static int dummy(void *fd) > { > char c; > /* Wait until the first child thread is killed by the OOM killer. */ > read(* (int *) fd, &c, 1); > /* Try to consume as much CPU time as possible via preemption. */ > while (1); You would kill the system by this alone. Having 1000 busy loops just kills your machine from doing anything useful and you are basically DoS-ed. I am not sure sprinkling preempt_{enable,disable} all around the oom path makes much difference. If anything having a kernel high priority kernel thread sounds like a better approach. [...] > for (i = 0; i < 1000; i++) { > clone(dummy, malloc(1024) + 1024, CLONE_SIGHAND | CLONE_VM, > &pipe_fd[0]); > if (!i) > close(pipe_fd[1]); -- Michal Hocko SUSE Labs -- 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>