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
F82315693: D2369.diff
Sat, Apr 27, 2:31 PM
F82277697: D2369.diff
Sat, Apr 27, 5:59 AM
Unknown Object (File)
Fri, Apr 26, 10:43 AM
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
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 Passed
Unit
No Test Coverage

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

(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

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 ↗(On Diff #5078)

This is useless, if my theory not wrong.

489 ↗(On Diff #5078)

Same here.

984 ↗(On Diff #5078)

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 ↗(On Diff #5078)

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

head/sys/kern/kern_racct.c
984 ↗(On Diff #5078)

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 ↗(On Diff #5078)

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 ↗(On Diff #5078)

Fine. I missed that the sysctl is RO only.