Re: [RFC][PATCH] Anonymous shared memory (ashmem) subsystem

From: Christoph Hellwig
Date: Mon Jul 18 2011 - 23:36:15 EST

On Mon, Jul 18, 2011 at 11:32:42PM -0400, Bryan Donlan wrote:
> The pinning stuff seems like a reasonable idea to me, but why should
> it be limited to ashmem using a private ioctl? If it were a proper
> syscall, I could see automatic discarding being useful in on-disk
> filesystems as well, for managing persistent caches.


> But yes, tmpfs
> already solved the problem of getting a shared-memory file descriptor
> - just open a random-name file in tmpfs, unlink it, and start passing
> it around.

Indeed. And as mentioned before using /dev/zero as the file will
get you a pre-unlinked tmpfs fd without any races, and without the
need of actually mounting shmem into any namespace.
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