Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 2024 12:24:29 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-fs <fs@FreeBSD.org>
Subject:   vn_alloc_cyclecount is always zero?
Message-ID:  <1181f483-7e88-4333-9b22-c76146ec82b2@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

It seems that after commit https://cgit.freebsd.org/src/commit/?id=8733bc277 
vn_alloc_cyclecount is always zero as the only code that modifies the variable 
is under a condition that the variable is already non-zero while its initial 
value is zero.

That does not look right because there is some consequential code that it is 
conditional on vn_alloc_cyclecount.
E.g.:
- vstir is never set;
- vn_alloc_hard never reaches 'goto alloc'.

I checked compiled code just in case and it looks that the compiler agrees with 
me: vn_alloc_cyclecount is optimized out as well as all code depending on it not 
being zero.

The vnode recycling code (with its many parameters and paths) has never been 
easy for me to understand, so I am not sure about all implications but there is 
one real-world problem that prompted me to look into the code.

-- 
Andriy Gapon




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1181f483-7e88-4333-9b22-c76146ec82b2>