On Sat, Sep 19, 2015 at 4:00 PM, Raymond Jennings <shentino@xxxxxxxxx> wrote: > > Potentially stupid question that others may be asking: Is it legal to return > EINTR from mmap() to let a SIGKILL from the OOM handler punch the task out > of the kernel and back to userspace? Yes. Note that mmap() itself seldom sleeps or allocates much memory (yeah, there's the vma itself and soem minimal stuff), so it's mainly an issue for things like MAP_POPULATE etc. The more common situation is things like uninterruptible reads when a device (or network) is not responding, and we have special support for "killable" waits that act like normal uninterruptible waits but can be interrupted by deadly signals, exactly because for those cases we don't need to worry about things like POSIX return value guarantees ("all or nothing" for file reads) etc. So you do generally have to write extra code for the "killable sleep". But it's a good thing to do, if you notice that certain cases aren't responding well to oom killing because they keep on waiting. Linus -- 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>