Repository navigation
Fix Solaris Kstat2 CPU vendor frequency reported in MHz instead of Hz - #3519
Conversation
SolarisCentralProcessorJNA.queryProcessorId2() (the Kstat2 path) read clock_MHz and passed it straight to ProcessorIdentifier as the vendor frequency, omitting the * 1_000_000L conversion to Hz that both the non-Kstat2 path in the same class and the FFM implementation apply. On a SPARC system this reported a ~5067 Hz vendor frequency against a ~5.07 GHz max. Caught by the CentralProcessorTest.testVendorFreqSanity() assertion added in #3518 (vendor and max frequency must be within an order of magnitude).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (9)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2026-04-06T04:45:47.644ZApplied to files:
📚 Learning: 2026-07-06T19:25:59.225ZApplied to files:
🔇 Additional comments (2)
📝 WalkthroughWalkthroughChangesSolaris processor frequency correction
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3519 +/- ##
============================================
- Coverage 78.36% 78.28% -0.08%
- Complexity 3817 4099 +282
============================================
Files 697 697
Lines 24104 24104
Branches 3994 3994
============================================
- Hits 18888 18869 -19
- Misses 3018 3043 +25
+ Partials 2198 2192 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Fixes the Solaris JNA Kstat2 processor identifier reporting the CPU vendor frequency in MHz instead of Hz.
SolarisCentralProcessorJNA.queryProcessorId2()(the Kstat2 path) read theclock_MHzkstat value and passed it straight toProcessorIdentifieras the vendor frequency, omitting the* 1_000_000Lconversion to Hz that both sibling code paths apply:queryProcessorId()), andSolarisCentralProcessorFFM.queryProcessorId()).On a SPARC system this reported a ~5067 Hz vendor frequency against a ~5.07 GHz max frequency.
How it was found
Caught by the
CentralProcessorTest.testVendorFreqSanity()assertion added in #3518 (vendor and max frequency must be within an order of magnitude) — the FreeBSD sysctl fix's regression test surfaced this pre-existing Solaris bug.Testing
This is a cfarm-only path:
HAS_KSTAT2is false on the OpenIndiana x86 CI runner, so the Kstat2 branch is only exercised on real Solaris. Verified by inspection against the two sibling paths that already perform the MHz→Hz conversion. Builds clean (checkstyle, forbiddenapis, javadoc).Summary by CodeRabbit