From owner-freebsd-fs@FreeBSD.ORG Tue Jun 22 09:51:16 2010 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC46D1065670; Tue, 22 Jun 2010 09:51:16 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEF38FC08; Tue, 22 Jun 2010 09:51:15 +0000 (UTC) Received: by bwz8 with SMTP id 8so1967681bwz.13 for ; Tue, 22 Jun 2010 02:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=LLE8Po9oFLHOLEEUyJAVsaIJ3xQ++kTmTNUzRP9VOqk=; b=f5YnnUdNclJ0DpTqdoZVQopLWfLQ3Zvn9v35ekBcLkz+zzQ1Y06nowgMh289aeFUmh gUThkdx3i/HlgUo04a0sq1p0+Gh4183UCb4AscO26JsHi+tIg07FIeLvh1CN0x2u+sAh KLaai1zKByPxzRqE+fQjwSZBXrxroa3wx+qKM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=XpUU5Tc2LvE2coYIU9Ghx74+QWu2GwNq90Iic5Vzc5pKaB5BZqlnjL5QA0sSYDQeS4 j7V62ksdFEQkwjs1k2Znp/PyjAz2thSBGFHMGuPyo6bAgma53Ha3Hx7JBuHqJyI4+L70 /chHVNCphIxNApTSlHjEVk0M/Y8L3ySoOCyWw= Received: by 10.204.73.195 with SMTP id r3mr3932255bkj.147.1277198438387; Tue, 22 Jun 2010 02:20:38 -0700 (PDT) Received: from localhost ([212.98.186.134]) by mx.google.com with ESMTPS id jx10sm9689320bkb.33.2010.06.22.02.20.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 02:20:37 -0700 (PDT) Date: Tue, 22 Jun 2010 12:20:44 +0300 From: Gleb Kurtsou To: Kostik Belousov Message-ID: <20100622092044.GA2958@tops> References: <20100621125825.GG13238@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100621125825.GG13238@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: alc@freebsd.org, pho@freebsd.org, fs@freebsd.org Subject: Re: Tmpfs elimination of double-copy X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 09:51:16 -0000 On (21/06/2010 15:58), Kostik Belousov wrote: > Hi, > Below is the patch that eliminates second copy of the data kept by tmpfs > in case a file is mapped. Also, it removes potential deadlocks due to > tmpfs doing copyin/out while page is busy. It is possible that patch > also fixes known issue with sendfile(2) of tmpfs file, but I did not > verified this. What is that sendfile issue you refer to? I though it was fixed: http://svn.freebsd.org/viewvc/base?view=revision&revision=197850 > > Patch essentially consists of three parts: > - move of vm_object' vnp_size from the type-discriminated union to the > vm_object proper; > - making vm not choke when vm object held in the struct vnode' v_object > is default or swap object instead of vnode object; > - use of the swap object that keeps data for tmpfs VREG file, also as > v_object. > > Peter Holm helped me with the patch, apparently we survive fsx and stress2. There is race issue in tmpfs_rename(). It can be easily provoked with blogbench. I don't remember details but it seems node from fdvp can disappear during call. Probably UFS-style exclusively lock all vnodes in VOP_RENAME() should work great for tmpfs. If you have ideas on how to fix it I'll find time to work on it, it's somewhat related to my dircache project. Thanks, Gleb.