Page MenuHomeFreeBSD

vfs: use refcnt int API
AbandonedPublic

Authored by mjg on Feb 3 2020, 3:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 12:31 PM
Unknown Object (File)
Nov 3 2024, 4:05 AM
Unknown Object (File)
Oct 18 2024, 3:46 AM
Unknown Object (File)
Oct 6 2024, 4:26 PM
Unknown Object (File)
Sep 8 2024, 8:42 PM
Unknown Object (File)
Sep 8 2024, 11:57 AM
Unknown Object (File)
Sep 8 2024, 12:56 AM
Unknown Object (File)
Sep 1 2024, 11:36 AM
Subscribers

Details

Reviewers
kib
jeff
Summary

Complete patch with a sweep which converts direct reads of v_holdcnt/v_uscount to vn_ref_read can be found here: https://people.freebsd.org/~mjg/vfs-refcnt.2.diff ; posted below is the non-mechanical part of the patch

This deduplicates all cases of hand-rolled sanity checks.

The switch away from refcount(9) also eliminates several runtime checks from non-debug kernels.

Note that since everything is touched this perhaps is an opportunity to rename holdcnt to holdcount for consistency with usecount.

For example this shortens vget_prep (148 -> 127 bytes), vget_finish (270 -> 218 bytes). This also converts vrefact from:

0xffffffff80726870 <+0>:	push   %rbp
0xffffffff80726871 <+1>:	mov    %rsp,%rbp
0xffffffff80726874 <+4>:	mov    $0x1,%eax
0xffffffff80726879 <+9>:	lock xadd %eax,0x1d0(%rdi)
0xffffffff80726881 <+17>:	test   $0x40000000,%eax
0xffffffff80726886 <+22>:	jne    0xffffffff8072688a <vrefact+26>
0xffffffff80726888 <+24>:	pop    %rbp
0xffffffff80726889 <+25>:	retq   
0xffffffff8072688a <+26>:	movl   $0x60000000,0x1d0(%rdi)
0xffffffff80726894 <+36>:	pop    %rbp
0xffffffff80726895 <+37>:	retq

to:

0xffffffff80725740 <+0>:	push   %rbp
0xffffffff80725741 <+1>:	mov    %rsp,%rbp
0xffffffff80725744 <+4>:	lock addl $0x1,0x1d0(%rdi)
0xffffffff8072574c <+12>:	pop    %rbp
0xffffffff8072574d <+13>:	retq

Meaning we should probably make it inline (along with vrefactn).

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped