Looks like we are in a deadlock here :)you're describing the deadlock here: all memory is full, no process which allocates memory can make any progress.
Yes they, can: the allocation will fail, function will return -ENOMEM,
malloc will return NULL, pagefault will fail with OOM. This is
progress, though not the best sort. It is most certainly _not_ a
deadlock.
So the userspace filesystem would pass that amount to the kernel. It's not pretty, but it is workable.This is not a true oom situation: there can be plenty of memory in
dirty pagecache which we could reclaim if we had that tiny bit of
reserve memory.
The amount of reserved memory that would be needed depends upon the
filesystem. Some filesystems would need only very little to be able
to free some memory, some would need a lot (e.g. a bzip2 compressing
filesystem). There's no magic solution with reserving memory.
And this is not unique to userspace filesystems, as Rik van RielThis looks like a bug to me. Maybe jiggling the thresholds would help.
pointed out earlier, network filesystems are also prone to deadlock:
http://lkml.org/lkml/2004/11/27/81
The situation with userspace filesystems is:I looked at ramfs, it isn't even limited. You can easily crash yourRight. But ramfs doesn't call a userspace process which calls the kernel right back.
system just by filling it up with data, but no deadlock will happen.
Doesn't matter one little whit. The end result is the same: Out Of
Memory, which is _not_ equivalent to deadlock. Please think it over.