Page MenuHomeFreeBSD

1/2 vfs: inline VOP calls if possible
AbandonedPublic

Authored by mjg on Feb 14 2020, 11:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 6:57 AM
Unknown Object (File)
Mon, Dec 23, 6:57 AM
Unknown Object (File)
Mon, Dec 23, 6:36 AM
Unknown Object (File)
Mon, Dec 9, 5:05 PM
Unknown Object (File)
Tue, Dec 3, 10:40 PM
Unknown Object (File)
Nov 23 2024, 10:46 PM
Unknown Object (File)
Nov 23 2024, 1:23 PM
Unknown Object (File)
Nov 20 2024, 8:30 AM

Details

Reviewers
kib
jeff
Summary

Most ops have nothing to do but to check for sdt probes and call the target routine. vop_*_pre/post processing is only present for few of them and even then it tends to be for debug purposes only.

Add debugpre/debugpost keywords which can be used for that purpose.

Then routines which end up with a SDT check + vop call get it added to the inline function is already there. This avoids a level of indirection most notably for lock1 and unlock.

Note the interface is pretty heavy as it is and it does not add much burden to callers.

This combined with other changes gives me a 10% speed up in fstat rate and a 4% speed up when running vfsmix [ https://lkml.org/lkml/2015/5/19/1009 ]

There is no change in generated code for debug kernels.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

It seems non-debug has only post handlers for knote etc.

Is it really so expensive to emit two function calls? Why not just always inline?

Note the actual routine still have to be generated for filesystems like nullfs (and in fact is generated twice -- once _AP and second time _APV, where the latter is inlined by the compiler into the former).

Inlining everything into top level callers in the current form does not really win much. What can and should be done in next step is to inline the pre/post stuff into _APV functions. Note they all start with checking for error == 0, but this condition is almost always true and is up for further rearrangement.

Perhaps most importantly this still pushes an argument struct on the stack which prevents tail-calling.

In other words there is plenty of work to do in the area and the above provides one logical step. Any further changes should be made separately and I may end up doing some of it later.

  • add 'debug' keyword to debug routines for consistency

something to this extent went in with r363708