Page MenuHomeFreeBSD

Convert cryptostats to a counter_u64 array.
ClosedPublic

Authored by markj on Jun 26 2020, 2:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 3 2024, 9:29 AM
Unknown Object (File)
Sep 5 2024, 10:33 PM
Unknown Object (File)
Sep 5 2024, 9:44 PM
Unknown Object (File)
Sep 5 2024, 9:22 AM
Unknown Object (File)
Sep 4 2024, 3:09 PM
Unknown Object (File)
Sep 2 2024, 6:28 AM
Unknown Object (File)
Sep 1 2024, 11:32 AM
Unknown Object (File)
Sep 1 2024, 3:51 AM
Subscribers

Details

Summary

The global counters were not SMP-friendly. Use per-CPU counters
instead.

These counters are of dubious usefulness to begin with, but I think
having a framework to easily add new counters is useful, so let's keep
them for now.

Note: we are changing the sysctl ABI, but it has changed once in HEAD
already since 12 was branched. (It was renamed in r359374.)

Diff Detail

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

Event Timeline

markj requested review of this revision.Jun 26 2020, 2:53 PM
markj created this revision.

I’m not keen on the struct <-> array coercion

sys/opencrypto/crypto.c
236 ↗(On Diff #73694)

Sizeof mismatches the structure type

markj marked an inline comment as done.

Fix the internal counter array size.

In D25466#562261, @cem wrote:

I’m not keen on the struct <-> array coercion

For what it's worth, this is how all of the network stats are handled as well.

Internally we use an array of counter_u64's and the sysctl handler for COUNTER_U64_ARRAY fetches the value for each stat out of the array. So really we are just assuming that struct cryptostats can be treated as an array of uint64_t.

This revision is now accepted and ready to land.Jun 26 2020, 6:31 PM
This revision was automatically updated to reflect the committed changes.