lkml.org 
[lkml]   [2011]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] Anonymous shared memory (ashmem) subsystem
From
Date
On Mon, 2011-07-18 at 23:36 -0400, Christoph Hellwig wrote:
> > 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.

"Why not use tmpfs?" was my gut reaction, too. The patch is named a bit
unfortunately, but I think the key bit in them is the "volatile" pages,
not the "anonymous" or "shared memory" features.

Those let userspace allocate things like caches, and lets the kernel
destructively (but safely) reclaim them when there's memory pressure
(implemented as a slab shrinker here). It's kinda like a kernel-driven
garbage collector, or even like a distant relative of those CMM2 patches
from the s390 folks a few years ago.

This implementation has some real show-stopper things in it, like its
own LRU. But, the concept seems interesting at least.

-- Dave



\
 
 \ /
  Last update: 2011-07-19 17:41    [W:0.105 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site