From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005Ab1GSDgL (ORCPT ); Mon, 18 Jul 2011 23:36:11 -0400 Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:53547 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230Ab1GSDgK (ORCPT ); Mon, 18 Jul 2011 23:36:10 -0400 Date: Mon, 18 Jul 2011 23:36:02 -0400 From: Christoph Hellwig To: Bryan Donlan Cc: Christoph Hellwig , John Stultz , LKML , Robert Love , Andrew Morton , Hugh Dickins , Mel Gorman , Dave Hansen , Rik van Riel , Eric Anholt , Jesse Barnes Subject: Re: [RFC][PATCH] Anonymous shared memory (ashmem) subsystem Message-ID: <20110719033602.GA4867@infradead.org> References: <1311015274-28650-1-git-send-email-john.stultz@linaro.org> <20110719021947.GA16986@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Exactly. > 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.