Page MenuHomeFreeBSD

Optimize the vm object bypass and collapse counters
ClosedPublic

Authored by alc on Dec 24 2017, 9:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 5:48 PM
Unknown Object (File)
Jan 15 2024, 9:21 AM
Unknown Object (File)
Dec 20 2023, 5:41 AM
Unknown Object (File)
Nov 17 2023, 3:57 AM
Unknown Object (File)
Nov 12 2023, 9:15 AM
Unknown Object (File)
Nov 11 2023, 11:43 AM
Unknown Object (File)
Nov 1 2023, 8:22 PM
Unknown Object (File)
Oct 16 2023, 2:52 AM
Subscribers

Details

Summary

Make the vm object bypass and collapse counters per-CPU counters.

Diff Detail

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

Event Timeline

vm/vm_object.c
151 ↗(On Diff #36980)

I probably don't need EARLY_COUNTER.

166 ↗(On Diff #36980)

I based the ordering, SI_SUB_CPU and SI_ORDER_ANY, on that found in vm_meter.c. I have no idea if this ordering is optimal.

kib added inline comments.
vm/vm_object.c
166 ↗(On Diff #36980)

I think it does not matter, collapses and bypasses start to occur only when forks are executed, which does not happen earlier than init startup. You used the same values as vmcounter_startup(), which is fine.

This revision is now accepted and ready to land.Dec 25 2017, 9:40 AM
vm/vm_object.c
153 ↗(On Diff #36980)

Should I put the description on its own line?

vm/vm_object.c
153 ↗(On Diff #36980)

Description on the new line is bde' preferred style. IMO it unnecessarily spends vertical space if the description fits into line length.

As an aside, it seems to me that sys/counter.h and/or the man page ought to provide guidance on when counter_u64_alloc() becomes possible. It appears to me that it is earlier than SI_SUB_CPU, specifically, we need the following to have completed:

SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL);
This revision was automatically updated to reflect the committed changes.
In D13611#284781, @alc wrote:

As an aside, it seems to me that sys/counter.h and/or the man page ought to provide guidance on when counter_u64_alloc() becomes possible. It appears to me that it is earlier than SI_SUB_CPU, specifically, we need the following to have completed:

SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL);

I believe @glebius has some plans to allow earlier creation of per-CPU counters.