Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2023 02:53:26 +0200
From:      Konstantin Belousov <kib@freebsd.org>
To:        YU SHANG <yushang@outlook.com>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   Re: about the vnode free list
Message-ID:  <ZUBQBhIDvkmRzhCJ@kib.kiev.ua>
In-Reply-To: <SN4PR17MB586231A4736EE906CF0B93E4A3A1A@SN4PR17MB5862.namprd17.prod.outlook.com>
References:  <SN4PR17MB586231A4736EE906CF0B93E4A3A1A@SN4PR17MB5862.namprd17.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 30, 2023 at 08:41:05AM +0000, YU SHANG wrote:
> Hi guys,
> I'm reading the man page of getnewvnode which says that the vnode is either freshly allocated or taken from the free list. What I can't understand is where is the free list,is it the vnode_list? Many thanks.
> 

There is indeed no free list.  For the long time, really unused vnode is
freed back to UMA.

The global vnode list contains vnodes that have the identity, this way the
filesystem' data cache is implemented.  When system needs a spare vnode and
the total vnode limit is reached, vnlru frees some cached vnode that seems
to be unused.  Read the code starting from vn_alloc(), there were recently
some rototiling of the code.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZUBQBhIDvkmRzhCJ>