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)
Jan 13 2024, 12:23 AM
Unknown Object (File)
Jan 12 2024, 5:15 AM
Unknown Object (File)
Nov 4 2023, 5:22 PM
Unknown Object (File)
Nov 4 2023, 2:46 PM
Unknown Object (File)
Sep 26 2023, 6:11 PM
Unknown Object (File)
Sep 18 2023, 1:10 PM
Unknown Object (File)
Sep 10 2023, 11:05 PM
Unknown Object (File)
Jul 9 2023, 5:00 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.