Repository navigation
Fix potential swap undercount on FreeBSD - #2123
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughFreeBSD swap reporting now uses one Suggested reviewers: Priority: ⬇️ Low Change: Bug fix Merge Risk: ⚪ Minimal · up to The change targets accurate FreeBSD swap totals, and the supplied evidence identifies no remaining actionable merge risk. 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. One call gathers swap totals Comment |
|
Would the |
4ab4dfc to
1ec61ed
Compare
Fixes potential
totalSwapandusedSwapundercount on FreeBSD.The original implementation only reads
ARRAYSIZE(swap) - 1(15) swap devices into the buffer and sum them astotalSwapandusedSwap. If a system has more than 16 devices, the original implementation would not count the remaining devices beyond 16 (maxswap = LEN = 16;kvm_getswapinfo()reads up tomaxswap - 1devices.).kvm_getswapinfo()reserves the last structure for a total sum of all devices, including those that are not written into the array:When
maxswap = 1, we get the grand total of all swap devices in the suppliedkvm_swapstructure.For proof and more information, please check GuillaumeGomez/sysinfo#1746.