From nobody Tue Oct 31 00:53:26 2023 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SKBTT1NgZz4ydhh for ; Tue, 31 Oct 2023 00:53:33 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SKBTS6rB8z4fVh for ; Tue, 31 Oct 2023 00:53:32 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.17.1/8.17.1) with ESMTP id 39V0rQ5N007060; Tue, 31 Oct 2023 02:53:29 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 39V0rQ5N007060 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 39V0rQPC007059; Tue, 31 Oct 2023 02:53:26 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Tue, 31 Oct 2023 02:53:26 +0200 From: Konstantin Belousov To: YU SHANG Cc: "freebsd-fs@freebsd.org" Subject: Re: about the vnode free list Message-ID: References: List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4SKBTS6rB8z4fVh 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.