Page MenuHomeFreeBSD

Add a 'SINGLETON' directive to kobj interface definition
ClosedPublic

Authored by jhibbits on Jan 18 2020, 1:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 4:43 PM
Unknown Object (File)
Thu, Nov 28, 7:08 PM
Unknown Object (File)
Nov 19 2024, 1:31 AM
Unknown Object (File)
Nov 18 2024, 9:56 PM
Unknown Object (File)
Oct 5 2024, 3:27 AM
Unknown Object (File)
Sep 25 2024, 1:01 AM
Unknown Object (File)
Sep 20 2024, 3:57 AM
Unknown Object (File)
Sep 20 2024, 3:57 AM
Subscribers
None

Details

Summary

This makes the interface described in the definition file act like a
pseudo-IFUNC service, by caching the found method locally.

Applying this to the PowerPC MMU definitions, it yields a significant
(15-20%) performance improvement, seen in both a 'make buildworld' and a
parallel build of LLVM.

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.Jan 18 2020, 1:34 AM

I would perhaps be inclined to just not use kobj for things that are performance sensitive to be honest. You aren't going to have kldload'able pmaps, so the ABI "win" that kobj gives you isn't really relevant. A simple struct with function pointers would probably give you even lower overhead than the singleton approach.

In D23245#509650, @jhb wrote:

I would perhaps be inclined to just not use kobj for things that are performance sensitive to be honest. You aren't going to have kldload'able pmaps, so the ABI "win" that kobj gives you isn't really relevant. A simple struct with function pointers would probably give you even lower overhead than the singleton approach.

I suspect that's another 5-7% as well. I click ok because it was an easy win and made this point to somebody 10 or 15 years ago at BSDcan.