This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Touch memory to count as RSS
ClosedPublic

Authored by Hahnfeld on Dec 31 2017, 3:53 PM.

Diff Detail

Event Timeline

Hahnfeld created this revision.Dec 31 2017, 3:53 PM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptDec 31 2017, 3:53 PM

How about using calloc instead and benefiting of the "included" zero'd memory feature? That would avoid implementing the touch function.
I won't be able to test anything before Jan. 2nd.

How about using calloc instead and benefiting of the "included" zero'd memory feature? That would avoid implementing the touch function.
I won't be able to test anything before Jan. 2nd.

calloc doesn't work because the kernel can use copy-on-write zero pages, see https://willnewton.name/uncategorized/calloc-versus-malloc-and-memset/ for a full explanation. I can use the mentioned memset though and get rid of the touch function :-)

Hahnfeld updated this revision to Diff 128385.Jan 1 2018, 1:59 AM

Use memset instead of custom touch function.

cryptoad accepted this revision.Jan 1 2018, 9:50 AM
cryptoad added a project: Restricted Project.
This revision is now accepted and ready to land.Jan 1 2018, 9:51 AM
This revision was automatically updated to reflect the committed changes.