Page MenuHomeFreeBSD

try to fix RACCT_RSS accounting
ClosedPublic

Authored by avg on Feb 6 2017, 6:55 PM.
Tags
None
Referenced Files
F111626853: D9464.id24810.diff
Thu, Mar 6, 5:12 AM
F111615331: D9464.id.diff
Thu, Mar 6, 1:23 AM
F111597417: D9464.id25152.diff
Wed, Mar 5, 7:28 PM
F111592113: D9464.diff
Wed, Mar 5, 5:32 PM
Unknown Object (File)
Fri, Feb 21, 11:34 PM
Unknown Object (File)
Fri, Feb 21, 11:33 PM
Unknown Object (File)
Sun, Feb 16, 5:17 AM
Unknown Object (File)
Thu, Feb 13, 2:28 PM
Subscribers

Details

Summary

There could be a race between the vm daemon setting RACCT_RSS based
on the vm space and vmspace_exit (called from exit1) resetting RACCT_RSS
to zero. In that case we can get a zombie process with non-zero
RACCT_RSS. If the process is jailed, that may break accounting for the
jail. There could be other consequences.

Add an assert that the RSS is zero when the process is reaped.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg retitled this revision from to try to fix RACCT_RSS accounting.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: kib, trasz, ler.

This is probably fine.

For unrelated reasons, I looked at vm_mmap_object() today and I think that the function would cause significant over-accounting in case the decides to return an error.

In D9464#195648, @kib wrote:

For unrelated reasons, I looked at vm_mmap_object() today and I think that the function would cause significant over-accounting in case the decides to return an error.

That's a good observation. I haven't seen any problems with the resources that are accounted there, but the code certainly does not handle the error paths properly. But that problem is for another day.

trasz edited edge metadata.
This revision is now accepted and ready to land.Feb 11 2017, 3:11 PM
This revision was automatically updated to reflect the committed changes.