Page MenuHomeFreeBSD

racct: Add new "persistent" property for resources
AcceptedPublic

Authored by cyril_freebsdfoundation.org on Jun 15 2021, 7:32 PM.

Details

Reviewers
markj
trasz
Summary

This adds a new "persistent" property that describes resources which can drop in usage but do not automatically get reclaimed when a process dies. They must instead be manually dropped. This correctly handles shared resources such as shared memory. Previously, shared memory resources would be automatically dropped when a process died and then dropped again whenever the shared memory object was closed, leading to incorrect accounting.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

What's the difference between this and RESOURCE_SLOPPY?

What's the difference between this and RESOURCE_SLOPPY?

The main difference is that RACCT_IS_SLOPPY is not in RACCT_CAN_DROP. An alternate solution could be to add RACCT_SLOPPY to RACCT_CAN_DROP and remove RACCT_RECLAIMABLE from RACCT_NSHM and RACCT_SHMSIZE.

I wonder, should it perhaps also apply to some other SysV IPC resources?

This revision is now accepted and ready to land.Nov 15 2021, 11:23 AM