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)
Fri, May 17, 9:51 PM
Unknown Object (File)
Wed, May 8, 5:46 PM
Unknown Object (File)
May 2 2024, 1:32 PM
Unknown Object (File)
Apr 29 2024, 11:01 PM
Unknown Object (File)
Apr 29 2024, 9:09 AM
Unknown Object (File)
Apr 8 2024, 11:19 AM
Unknown Object (File)
Feb 2 2024, 4:23 AM
Unknown Object (File)
Jan 30 2024, 12:50 PM
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