From owner-svn-src-head@freebsd.org Mon Nov 30 04:01:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 699E1A3BE55; Mon, 30 Nov 2015 04:01:28 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C88F1C00; Mon, 30 Nov 2015 04:01:28 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by pabfh17 with SMTP id fh17so175728948pab.0; Sun, 29 Nov 2015 20:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=arpVEtuACI74/3D365i86KpReSIGm1l0UZxpdFcICwE=; b=cEqFlTgReXxMuSmK3ulXDl+L8VvSIh1c/ibL0LQVahssX01njqrYZP0H9wybHNJfDT 2KSCPsaXR6w3H2QDAEW+cfA6PSGYUJSg2nhd6kk3+PNMFfDQB+IQ9M/0yfHqBvRJ3r36 PdxWr6Uz0gXOG6ZIysN2lG8Opqh/14MqCIvGYaTWrHCD1yDS79Y6ejfbDe3MEnrxnPVi w38FnZ/kdAu1wWkpwiKysNdKP4TlBcvaeX2PvbB2HF1hUq+hyKEAZnSJQkERouw/geKY 3EVpBXEtQmrVJoLUc9kkIPyn09sflvfGmFVfowK/qfecMaGye9m/gKqbk0Kv0v624G8z NRpA== X-Received: by 10.98.73.147 with SMTP id r19mr68325895pfi.39.1448856087861; Sun, 29 Nov 2015 20:01:27 -0800 (PST) Received: from ?IPv6:2001:44b8:31ae:7b01:8c9:9bca:33f3:dd9? (2001-44b8-31ae-7b01-08c9-9bca-33f3-0dd9.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:8c9:9bca:33f3:dd9]) by smtp.gmail.com with ESMTPSA id c20sm47512934pfd.17.2015.11.29.20.01.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Nov 2015 20:01:27 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r291460 - head/sys/kern References: <201511292142.tATLgQW0042923@repo.freebsd.org> To: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <565BCA11.4090600@FreeBSD.org> Date: Mon, 30 Nov 2015 15:01:21 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <201511292142.tATLgQW0042923@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 04:01:28 -0000 On 30/11/2015 8:42 AM, Kirk McKusick wrote: > Author: mckusick > Date: Sun Nov 29 21:42:26 2015 > New Revision: 291460 > URL: https://svnweb.freebsd.org/changeset/base/291460 > > Log: > As the kernel allocates and frees vnodes, it fully initializes them > on every allocation and fully releases them on every free. These > are not trivial costs: it starts by zeroing a large structure then > initializes a mutex, a lock manager lock, an rw lock, four lists, > and six pointers. And looking at vfs.vnodes_created, these operations > are being done millions of times an hour on a busy machine. > > As a performance optimization, this code update uses the uma_init > and uma_fini routines to do these initializations and cleanups only > as the vnodes enter and leave the vnode_zone. With this change the > initializations are only done kern.maxvnodes times at system startup > and then only rarely again. The frees are done only if the vnode_zone > shrinks which never happens in practice. For those curious about the > avoided work, look at the vnode_init() and vnode_fini() functions in > kern/vfs_subr.c to see the code that has been removed from the main > vnode allocation/free path. > > Reviewed by: kib > Tested by: Peter Holm > > Modified: > head/sys/kern/vfs_subr.c > Kirk, Very interesting. Any estimation / expectation on the performance impact^W benefit of this, and in what scenario's / use-cases it might be particularly beneficial? Any benchmarks or tests you can share? ./koobs