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: Fri, 03 Apr 2009 14:41:48 +0100 Message-ID: <10789.1238766108@redhat.com> References: <29524.1238696291@redhat.com> <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: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, nfsv4@linux-nfs.org, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org To: Christoph Hellwig , Nick Piggin Return-path: In-Reply-To: <29524.1238696291@redhat.com> 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 David Howells wrote: > + data = kmap(page); > + old_fs = get_fs(); > + set_fs(KERNEL_DS); > + ret = file->f_op->write( > + file, (const void __user *) data, PAGE_SIZE, > + &pos); > + set_fs(old_fs); > + kunmap(page); Hmmm... Now I've thought about it some more, I'm not sure this is a good idea. Can this run a system out of kmap() resources? These are run by a dynamic thread pool, where each thread in the pool can do a kmap and issue a write, but the write may get delayed for a significant amount of time for a number of reasons - such as block allocation, data fetching and memory allocation. David