Page MenuHomeFreeBSD

powerpc/pmap64: Make moea64 statistics optional
ClosedPublic

Authored by jhibbits on Jul 10 2019, 12:00 AM.
Tags
None
Referenced Files
F80155067: D20903.id60115.diff
Thu, Mar 28, 3:48 PM
Unknown Object (File)
Wed, Mar 6, 12:51 AM
Unknown Object (File)
Sat, Mar 2, 1:49 AM
Unknown Object (File)
Jan 31 2024, 3:27 PM
Unknown Object (File)
Jan 13 2024, 6:30 PM
Unknown Object (File)
Jan 10 2024, 11:44 PM
Unknown Object (File)
Dec 26 2023, 11:22 PM
Unknown Object (File)
Dec 22 2023, 12:32 AM
Subscribers

Details

Summary

It turns out statistics accounting is very expensive in the pmap driver,
and doesn't seem necessary in the common case. Make this optional
behind a MOEA64_STATS #define, which one can set if they really need
statistics.

This saves ~7-8% on buildworld time on a POWER9.

Found by bdragon.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 25278
Build 23944: arc lint + arc unit

Event Timeline

Looks good.
But I think MOEA64_STATS should become a kernel config option, to make it easier to enable the statistics and to have this option documented.

Can these easily become per CPU counters instead? It seems like that would explain the performance loss, but per cpu should have hardly any overhead.

Yeah, counter(9) seems like the actual solution here.

What do the statistics give us in general for pmap? I don't see statistics on other archs, so I'm not sure what the benefit is. I understood for bringup and early stabilization, but we're in pretty solid territory now.

Not opposed to counter(9), just curious its value now.

That's a fair point. I've used them to assess hash-table spill rates when performance is not great, but not for a long time. We could also just delete them.

I still see merit in keeping statistics available, for assessing performance issues as you mentioned, but I don't see it necessary in the general case. If there are no objections, I'll take @luporl's request and add an option for MOEA64_STATS, possibly enabled in CURRENT, but disabled in STABLE.

Make MOEA64_STATS a compile option

luporl added inline comments.
sys/powerpc/pseries/mmu_phyp.c
31

Wouldn't it be better to include opt_pmap.h at mmu_oea64.h only?

This revision is now accepted and ready to land.Jul 24 2019, 10:54 AM
jhibbits added inline comments.
sys/powerpc/pseries/mmu_phyp.c
31

Generally we want to keep opt_* includes out of header files. But in this case it's a private header that's not installed at all, so I can do that.

This revision was automatically updated to reflect the committed changes.
jhibbits marked an inline comment as done.