fix: AIX memory statistics: add Available field and improve swap calculations#1982
fix: AIX memory statistics: add Available field and improve swap calculations#1982Dylan-M wants to merge 6 commits into
Conversation
541afe7 to
cd63eb7
Compare
cd63eb7 to
af34779
Compare
af34779 to
0fa1bb4
Compare
cf6175e to
964cf10
Compare
964cf10 to
d8f5fc7
Compare
fc8f669 to
1233a38
Compare
shirou
left a comment
There was a problem hiding this comment.
Hi @Dylan-M, I've reviewed this PR more carefully. Unlike your other PRs, this one is relatively small, has a single concern, and is focused only on AIX — which made it much easier to review thoroughly. I appreciate that.
I'm happy to merge this with the following changes:
- Handle GB (and potentially other units) in
lsps -aparsing: The current code assumes the size column always ends with "MB", butlspscan report sizes in GB on larger systems. Please handle at least MB and GB. - Add a unit test for
SwapDevicesWithContext(nocgo path): Thelsps -aparsing logic should have a test with sample output, similar to how other packages test their command parsing.
These are small fixes — once addressed, this is good to merge. Thanks!
0ec928c to
a420654
Compare
All of the rest should be resubmitted soon, in atomic PR "stacks".
Thanks for catching that, none of my test systems have had larger. I've now updated it to match as high as AIX kernel docs show (TB). If we ever run into a case of needed higher than TB, we can revisit.
Yup, That was just me forgetting to add it. Thank you.
No, thank you sir. Sorry for being such a pain - it is a lot of work and you were entirely correct it should have been split up better. |
|
@shirou This PR has been updated to address your review feedback:
Ready for re-review when you have a moment. Thanks! |
|
|
@shirou All three points addressed:
|
d6c4887 to
53d3db6
Compare
53d3db6 to
085438a
Compare
shirou
left a comment
There was a problem hiding this comment.
Overall looks good. I'd like to see tightened before merge.
|
Tested empirically on AIX 7.3.0.0 — across 30 sequential samples with a 500ms cadence, The relaxation was appropriate for an earlier iteration of this PR where |
fbb29ee to
a2a3865
Compare
|
@shirou — going to follow your guidance and close out the AIX stack to restart with the one-PR-at-a-time discipline you asked for. The other 20+ PRs and the tracking issue close today. One carve-out question on this PR specifically: it's been through three rounds of your review, the changes you asked for in the last round are in, and the diff is strictly AIX-only ( |
Summary
Fixes and improves AIX memory statistics for the nocgo path:
Memory (callSVMon)
availablecolumn insvmon -G -O unit=KB, which includes free pages plus reclaimable cache. This value cannot be derived from raw page counts alone.svmon -Gpage output and multiplied byos.Getpagesize(), avoiding the sub-KB truncation that-O unit=KBintroduces. A secondsvmoncall with-O unit=KBis made only to read theavailablecolumn.swap.Usedis now explicitly set, andswap.UsedPercentis calculated.parseSVMonPages()andparseSVMonAvailable()are separate functions with table-driven unit tests using real AIX sample output.Swap Devices (SwapDevicesWithContext)
parseLspsSize()now handles MB, GB, and TB suffixes inlsps -aoutput.parseLspsOutput()andparseLspsSize()have comprehensive tests covering MB, GB, NaNQ (NFS paging spaces), multiple devices, and edge cases.CGO path (mem_aix_cgo.go)
perfstat.PagingSpaceStat().Only affects AIX — no cross-platform changes.