]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
timecounter: Lock the timecounter list
authorMark Johnston <markj@FreeBSD.org>
Sat, 16 Oct 2021 13:46:55 +0000 (09:46 -0400)
committerMark Johnston <markj@FreeBSD.org>
Mon, 18 Oct 2021 13:56:59 +0000 (09:56 -0400)
commit621fd9dcb2d83daab477c130bc99b905f6fc27dc
tree5c7912929be6d5e76d4bd4b43f85114fe458d6f5
parent06ebadc5f555fd7fa6f869af1e5daf834b1bb04e
timecounter: Lock the timecounter list

Timecounter registration is dynamic, i.e., there is no requirement that
timecounters must be registered during single-threaded boot.  Loadable
drivers may in principle register timecounters (which can be switched to
automatically).  Timecounters cannot be unregistered, though this could
be implemented.

Registered timecounters belong to a global linked list.  Add a mutex to
synchronize insertions and the traversals done by (mpsafe) sysctl
handlers.  No functional change intended.

Reviewed by: imp, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32511
sys/kern/kern_tc.c