Page MenuHomeFreeBSD

Add kern.racct.enable tunable and RACCT_DISABLED config option.
ClosedPublic

Authored by trasz on Apr 25 2015, 5:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 8 2024, 10:08 PM
Unknown Object (File)
Jan 8 2024, 10:08 PM
Unknown Object (File)
Jan 8 2024, 10:08 PM
Unknown Object (File)
Jan 8 2024, 10:08 PM
Unknown Object (File)
Jan 8 2024, 9:16 PM
Unknown Object (File)
Dec 20 2023, 12:47 AM
Unknown Object (File)
Sep 26 2023, 10:34 PM
Unknown Object (File)
Sep 1 2023, 6:45 AM
Subscribers

Details

Summary

Add kern.racct.enable tunable and RACCT_DISABLED config option. The point of this is to be able to add RACCT (with RACCT_DISABLED) to GENERIC, to avoid having to rebuild the kernel to use rctl(8).

Diff Detail

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

Event Timeline

trasz retitled this revision from to Add kern.racct.enable tunable and RACCT_DISABLED config option..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
sys/kern/kern_racct.c
323 ↗(On Diff #5002)

(Random place). I do not see much value in these asserts, are you trying to catch missed #ifdef RACCT braces ?

If keeping them around, I suggest making the whole statement a macros, like ASSERT_RACCT_ENABLED();

sys/vm/vm_pageout.c
1792 ↗(On Diff #5002)

Better put only the last argument under the #ifdef, otherwise it is quite confusing.

Add ASSERT_RACCT_ENABLED() and reword the conditional in vm_pageout.c.

kib edited edge metadata.
This revision is now accepted and ready to land.Apr 27 2015, 3:06 PM
This revision was automatically updated to reflect the committed changes.
op added inline comments.
head/sys/kern/kern_racct.c
461

This is useless, if my theory not wrong.

489

Same here.

984

This does not cause memory leak?

The steps in theory:

  1. enable the resource accounting
  2. start a random process
  3. disable resource accounting before the process exit
  4. wait to the process exit or kill the process

Before this change, the racct_destroy() was always gets running.

head/sys/kern/kern_racct.c
489

This expression should be against "*racct == NULL" instead of "racct_enable".

head/sys/kern/kern_racct.c
984

The step #3 cannot ever happen; racct_enable is a tunable, not a sysctl - for this and several others, quite fundamental, reasons.

head/sys/kern/kern_racct.c
81

Ahh, I see now. That's a RO sysctl.
Could you please add a comment here, to explain, that this never should be RW?

984

Fine. I missed that the sysctl is RO only.