Page MenuHomeFreeBSD

ZFS vn_rele_async: ctach up with the use of atomics for the vnode use count
ClosedPublic

Authored by avg on Mar 27 2018, 4:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 24 2024, 12:05 AM
Unknown Object (File)
Mar 17 2024, 11:09 AM
Unknown Object (File)
Jan 10 2024, 1:47 AM
Unknown Object (File)
Dec 27 2023, 3:43 PM
Unknown Object (File)
Nov 10 2023, 10:16 PM
Unknown Object (File)
Nov 10 2023, 1:32 PM
Unknown Object (File)
Nov 8 2023, 1:30 PM
Unknown Object (File)
Nov 8 2023, 7:57 AM
Subscribers

Details

Summary

It's not sufficient nor required to use the vnode interlock when checking
if we are going to drop the last use count as the code in vputx() uses
atomic operations for both checking and decrementing the use code.
Apply the same method to vn_rele_async().
While here, remove vn_rele_inactive(), a wrapper around vrele() that didn't
add any value.

Also, the change required making vfs_refcount_release_if_not_last() public.
I've made vfs_refcount_acquire_if_not_zero() public as well.
They are in sys/refcount.h now. Maybe this is not the best header or maybe
the names need to drop "vfs" prefix.

Sponsored by Panzura.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 27 2018, 4:40 PM
sys/sys/refcount.h
83 ↗(On Diff #40802)

The symbol from refcount.h should not abuse vfs_ namespace.

Also, note that acquire in the name of the function does not follow common use of the term WRT the atomic API.

sys/sys/refcount.h
83 ↗(On Diff #40802)

I can drop the prefix if that's the request and Mateusz does not have a different opinion.

Regarding "acquire" -- yes, it's meaning is different from atomics, but is the same as in refcount_acquire.

sys/sys/refcount.h
83 ↗(On Diff #40802)

These inlines were supposed to be temporary bandaids until a general refcount_* primitives get implemented. I don't remember now what exactly stopped the effort at the time, someone(tm) should revisit this. I have a weak recollection that part of the point here was to either drop OR grab a lock while within the primitive. I guess a weaker variant which is equivalent to what's seen here is good enough for general use as well.

In the meantime I don't see a problem with having these named like this. The intent is to remove them soon anyway and just drop the vfs_ prefix here. Renaming is completely indifferent to me.

drop vfs_ prefix from the refcount "if_not" functions

This revision now requires review to proceed.Mar 28 2018, 8:22 AM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 28 2018, 8:55 AM
This revision was automatically updated to reflect the committed changes.