Re: [PATCH 1/3] NOMMU: Provide shared-writable mmap support on ramfs

From: David Howells
Date: Wed Nov 23 2005 - 14:23:29 EST

Linus Torvalds <torvalds@xxxxxxxx> wrote:

> > (3) Not permitting a file to be shrunk if it would truncate any shared
> > mappings (private mappings are copied).
> Why?
> Truncate is _supposed_ to get rid of any shared mmap stuff.

Yeah... but under _NOMMU_ conditions, it can't. There's no MMU around to
enforce the fact that the mapping has been shrunk.

Imagine two processes: one creates a shmem file and makes it a certain size;
both processes mmap it; then one of the processes attempts to shrink it. The
process that shrank it knows it has been shortened and that the memory has
been release, but the second process may not. Splat.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at