Page MenuHomeFreeBSD

try to fix RACCT_RSS accounting
ClosedPublic

Authored by avg on Feb 6 2017, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 12:27 AM
Unknown Object (File)
Mar 8 2024, 10:49 PM
Unknown Object (File)
Feb 13 2024, 11:43 AM
Unknown Object (File)
Dec 27 2023, 6:46 AM
Unknown Object (File)
Dec 27 2023, 6:46 AM
Unknown Object (File)
Dec 23 2023, 9:00 PM
Unknown Object (File)
Dec 23 2023, 4:17 AM
Unknown Object (File)
Dec 9 2023, 4:40 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.