From owner-freebsd-fs@FreeBSD.ORG Thu Jul 25 16:04:39 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 302CF8B8; Thu, 25 Jul 2013 16:04:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 080712118; Thu, 25 Jul 2013 16:04:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED311B926; Thu, 25 Jul 2013 12:04:37 -0400 (EDT) From: John Baldwin To: Andriy Gapon Subject: Re: VOP_MKDIR/VOP_CREATE and namecache Date: Wed, 24 Jul 2013 15:52:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <51E968FC.20905@FreeBSD.org> <201307221110.32011.jhb@freebsd.org> <51EFC854.3090908@FreeBSD.org> In-Reply-To: <51EFC854.3090908@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201307241552.09988.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Jul 2013 12:04:38 -0400 (EDT) Cc: freebsd-fs@freebsd.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 16:04:39 -0000 On Wednesday, July 24, 2013 8:28:04 am Andriy Gapon wrote: > on 22/07/2013 18:10 John Baldwin said the following: > > On Friday, July 19, 2013 12:27:40 pm Andriy Gapon wrote: > >> > >> Should VOP_MKDIR and VOP_CREATE immediately insert newly created vnodes into the > >> namecache? If yes, where would it be done best? FS code, VFS code, VOP > >> post-hooks, something else? > > > > Hmm, I'm not sure. However, if it is done, I think it needs to be done in the > > FS code (e.g., NFS needs to be able to add it's special timestamps). > > > > In UFS you could do this by just adding a cache_enter() call to ufs_direnter(). > > For NFS you would want the post-op attrs from the RPC reply (assuming it includes > > attrs for the parent directory). > > > > I've read this as "don't bother" :-) > Thank you for the feedback! Well, for UFS it would be a one-line change. If there is a common workload where this would help it might be interesting to benchmark. Note that UFS is careful to prime new directory entries into the existing dirhash for example (which may make priming the namecache less of a win for UFS). -- John Baldwin