From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH 22/43] CacheFiles: Add a hook to write a single page of data to an inode [ver #46] Date: Thu, 02 Apr 2009 18:22:32 +0100 Message-ID: <7397.1238692952@redhat.com> References: <20090402165505.GA21859@infradead.org> <200904030100.05741.nickpiggin@yahoo.com.au> <200904030232.59355.nickpiggin@yahoo.com.au> <20090402163712.GA25177@infradead.org> <200904030347.21470.nickpiggin@yahoo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Nick Piggin , nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: In-Reply-To: <20090402165505.GA21859@infradead.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfsv4-bounces@linux-nfs.org Errors-To: nfsv4-bounces@linux-nfs.org List-Id: linux-fsdevel.vger.kernel.org Christoph Hellwig wrote: > > I don't think "write_one_page" sounds like a particularly good new > > API addition. > > I also thing it's not a nice one. I still haven't seen a really good > explanation of why it can't just use plain ->write ->write requires: (1) A struct file. Refer to the ENFILE problem that my patch to do this raised. The problem is that doing a tar of, say, a kernel tree immediately opens ~30000 files internally, and then userspace falls over with ENFILE all over the place. My tests multiply that by 8. You (at least I think it was you) refused to countenance allocating file structs internally to the kernel that weren't accounted. (2) A pointer to a buffer. That means kmapping a page for the duration of the write. ->write is quite heavy. For something like ext3 it goes down through quite a few layers, in and out of the fs, VM and VFS. All this takes both time and stack space. I want to write a whole page from the kernel at a page-boundary in the file. That means it is possible to use an extremely optimised aop to do that. Really, what I want to do is have the filesystem issue its BIOs directly on the netfs page, but the Ext3 people I talked to at the time thought that would be too difficult to track. David