From nobody Fri Nov 1 10:24:29 2024 X-Original-To: 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 4Xfxmw2J84z5cByg for ; Fri, 01 Nov 2024 10:24:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xfxmw0PPSz42pw for ; Fri, 1 Nov 2024 10:24:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730456672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:autocrypt:autocrypt; bh=SHUOtMRJ3SfVe5t5ULwU3f2X1K0X6YUTbNrl8+AFp9Q=; b=sxtI5zmNxvEiXGitsVuN0cwJUUpfKIPcOsYrJOfbQLMEVQ6DzWnypIAGCPWNzNXc0zZ7dM Blo3mOUbjrxmPmEBmr65/v/6T8oaISKmIVdmn/b0cWiiCEDjnY7xZVlkAr2yU+o4Ehz3dq 0NRGNPAoKoWuq+foN9JgyLQa56vgsmwio7y+25w6Y9zbIk22X2ZMc/cFlVJ9PdG1CnKcZT 8kDcX4zC88dxkEG8HUhNNZ6ZYVdL2je4rdFaihENpvpgwjUIXxksf0Baz18aK1Be5oz4d2 kTyrV97PbRRw6EJuWDBKs9SgTX8SAMRXebAMra7YubdF96kj17yEIY/CfB+AtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730456672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:autocrypt:autocrypt; bh=SHUOtMRJ3SfVe5t5ULwU3f2X1K0X6YUTbNrl8+AFp9Q=; b=GdFX86BdCA2DZqYTLQCgl8gFf5hZROvsmd1BaVV00FBy5ilvGfPxB5bgcU5F5ki6Iu1TqE XvV/E9L7Hb/221vuL+m7hm+MPhtn7MR3JaCoXpI9WbMSmzD8iWc36PtaFrRnjWw4yTxsdI 1RYeT4ukp1713BPFnJw0Vl8B3b8MOgSH7jsr8Gw2TECtc9AwgDwyZakx2tMgstF5Vs6eHf 36bJ77BzvWeGIsQVMwIWA1lOeWZYeV4OqErvjfc1MRaxUZs2H2C8TKp8xm9/7oqT+xDP0C lXFMkeoyKujdCPDh18x+8nXwqICZjM2OW5q/uMpMcDZn4uZnxsmhdnGylvIFFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730456672; a=rsa-sha256; cv=none; b=f18EcWLzOyNbqC7k5G6y7vmUViL0/alRvB/8XHOUnwUVNsKVKE7dAH0sxNfxEoCID3XEoo dQXzguSscw0jSZNJrBpGBa8Nqw1m7Uq42qKuhjNkktk6ilgWq8mqw9ITi4w1x7dDLELowt g0edjwir4iH+bryWuPareNKdZMVcxHhZz7rFfX3e2ZLnjBXhf4EuWutCQ/e/Ol35UhL0SS J68VzBXEEil1auvoqUiXUBJlbQllW9TE7CutFrIeR972qAbQo+6d0y73WXZfNXgBu7M8NH +65y7RQKBzMwoAT0ZqeflWWmMIVlnf9akytSaJaFeUCJqKplwAI+a1Dn1k0MRg== Received: from [192.168.0.88] (unknown [93.188.39.137]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Xfxmv5LBGz1VGl for ; Fri, 1 Nov 2024 10:24:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Message-ID: <1181f483-7e88-4333-9b22-c76146ec82b2@FreeBSD.org> Date: Fri, 1 Nov 2024 12:24:29 +0200 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 User-Agent: Mozilla Thunderbird From: Andriy Gapon Subject: vn_alloc_cyclecount is always zero? To: freebsd-fs Content-Language: en-US Autocrypt: addr=avg@FreeBSD.org; keydata= xsDNBGcKrHEBDADRvwQOK0b/yo4ys5cs6bOQMhEh4xtfbaZ/CU00cpPgUip3sOZCdrtMWlRC g25z97prxE9pKueZi+HXDhIPpa9xl14ghqF4oYScuJ1i18HyiOH2y5Q3Vv/TtFiSzicd3EAu QgS3jVidpgDSPDdj2Yz3UxYpZ+PuFl6nOnvCvqOFcjUlzKCyPaiN2b86l1Nscmhnc+zQ/faB erUOEFEDQbWMA5YfXi8HrbeR16hfRfGt7E0aMDlIj9FIPIq71UWMN9CimPgs4+rbNr1MAlLa z4GxSDhVYZEY5rqtCzr+PLXboRQWnaUwXl0/biw9enf17NHdYv1SNAFTX2eC4dZ3qBVI74dS PgNprm+PMfz+6Hhs/dAv+Nan5nVhg3EFIjYTiy0MnjMSq8uI0v0ykpAGAcJJ5xl6d23aLxgN 6f0z6pJRCO0hGPgU7UzvFD0MxJxmbzqdT1R51KDan1oD41b+tjl2LMBuCDCoB0U44Pu0zLdp xMfFTxCXtwIYKIUxwd28jwMAEQEAAc0eQW5kcml5IEdhcG9uIDxhdmdARnJlZUJTRC5vcmc+ wsENBBMBCAA3FiEEmXvSmjiQFHPVOpLnzDOt5NLj67sFAmcKrHEFCQeEzgACGwMECwkIBwUV CAkKCwUWAgMBAAAKCRDMM63k0uPru5tSDACFK15LLbq89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HPVOpLnzDOt5NLj67sFAmcKrHMFCQeEzgACGwwACgkQzDOt 5NLj67sUCAv5AXqgWnYN9EblapMbZjkiqL8pZQ0GNqh+Pg9FwbyULxjtRTO6rD4D0IxizByb ef+neeUNyYlagt5nfKMysEr0SU/gHKCi8vyTF/63ukMrGUNGmJJxrndl5ZYKC6j6eX7twrZF L1Uvlmn6FnQ22red5kHO93fDjG4zaDIZvHfwj7kzjZ4tpC7Byinf88s14mdZeScc0PnU2hj4 UGYju/wg2FF4YxaZYhcmdTiRYY0Wx85XSMZv19pnn78sadEuRvfRd4JTmw++j1xGXeqQGWzz /CTG5/Ex9GAkQ02hZbmi236byDXoet4G8TEyOph9QFVkV9bNd0jQZaFZPGEj4PSPUYGAF7s5 xJaNGgctC3aZ7WjEv1FBoo44XCU4xcjJ1wZQUrHxRhx6TW0Jtcl0U9qfKFW30TSPo6RyiXuj X4ltWKAtjoXB8nUmEJckaz7IRu2b4pXDeazZuz5JBygUs10yJjDxh2vFQZo0KaBAPx9MZlPn gpPTjT15L8xGftEjQXF6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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