This change adds a GetRSS method on Linux that parses
the number from /proc/self/statm. This change is part
of splitting up https://reviews.llvm.org/D126752.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the review! @vitalybuka :)
compiler-rt/lib/scudo/standalone/tests/common_test.cpp | ||
---|---|---|
72 | Let me check that. |
compiler-rt/lib/scudo/standalone/linux.cpp | ||
---|---|---|
184–192 | static is not done? | |
198 | It's correct, but () are redundant or even just make it for loop for (;*pos >= '0' && *pos <= '9'; ++pos) rss = rss * 10 + static_cast<u64>(*pos) - '0' | |
compiler-rt/lib/scudo/standalone/tests/common_test.cpp | ||
74–83 | can you please hide everything as static you can e.g. new int[10000000], memset, and see that RSS before and after is ~10M |
Can we use the LLVM style for this change?
eg: no k* constants, casing for pos, fd etc.
Done :) I don't have commit access to LLVM, can you or someone else commit the patch for me?
Thanks! Missed one :)
compiler-rt/lib/scudo/standalone/internal_defs.h | ||
---|---|---|
93 ↗ | (On Diff #481297) | LLVM naming + no C-cast please |
Just a heads up that this seems to be breaking one of our bots: https://lab.llvm.org/staging/#/builders/14/builds/1305.
I am building LLVM to confirm this, will update in a bit.
Oh. I think I know where this comes from - for fixing this: Would I submit to this changelist or open a new one?
Thanks for taking a look at this!
If it's a minor one line fix then you can just add another patch. If it needs significant changes to fix, then you can revert the patch, fix it and then commit it again...
If you were asking about using this phabricator review, I think this one is closed and a new one would be needed.
Let me know if you need any help.
Thanks again!
Hi there @vitalybuka @1c3t3a! I am now realizing that we are experiencing some intermittent failures with the GetRssFromBuffer test case (sometimes it fails, and sometimes it passes) on PPC.
Specifically, the EXPECT_LE() failure (when it does fail) will look like this, where the Rss - AllocSize - Prev can succeed the Error (3000000):
/home/amyk/community/llvm-project/compiler-rt/lib/scudo/standalone/tests/common_test.cpp:93: Failure Expected: (std::abs(Rss - AllocSize - Prev)) <= (Error), actual: 3708544 vs 3000000
I am noticing a couple things with respect to this test case:
- This test can can fail on any iteration of the for loop (sometimes it can fail on the first iteration, other times the ninth, etc.)
- The amount that it fails with is always 3708544. It is always 708544 more than the expected error.
- I could be mistaken, but the Rss prior to the EXPECT_LE() check always appears to be less than Prev + AllocSize. Perhaps something is being deallocated here?
Basically, I'd like to try to understand this test case a bit more and was wondering if any of you have any thoughts with regards to this issue I am seeing on this test case.
Moreover, I was wondering if there was a specific justification behind having Error be 3000000, as we can see in my example, it is possible to exceed this value.
Any assistance and/or insight would be greatly appreciated! Thanks in advance.
Anther way to test this is instead of failure on the first EXPECT_LE, we rather count mismatches and after the loop we check that count is e.g. <=3
That could be possible. Just curious, is 3 just an arbitrary value that we can pick, or is there any particular reason that we would pick that?
Thanks @vitalybuka for the explanation. Were we still planning to update this test case in the future?
I am not looking into that. Would you be interested to send a patch to improves the test for your platform?
Thanks for getting back to me, @vitalybuka! I've discussed this offline with a few others from our backend and we are deciding to disable this test on Power for the time being. I will follow up with a commit shortly for this.
It looks unrelated