Skip to content

zfs: use atomic.Value for lock-free cache reads#3763

Merged
dims merged 1 commit intogoogle:masterfrom
dgrisonnet:zfs-reduce-lock-contention
Dec 4, 2025
Merged

zfs: use atomic.Value for lock-free cache reads#3763
dims merged 1 commit intogoogle:masterfrom
dgrisonnet:zfs-reduce-lock-contention

Conversation

@dgrisonnet
Copy link
Contributor

The ZfsWatcher cache is read frequently by container housekeeping goroutines while being updated every 15 seconds by Refresh(). Using atomic.Value allows lock-free reads, eliminating contention between readers and the single writer.

The ZfsWatcher cache is read frequently by container housekeeping
goroutines while being updated every 15 seconds by Refresh(). Using
atomic.Value allows lock-free reads, eliminating contention between
readers and the single writer.

Add usageCache typed wrapper to eliminate boilerplate type assertions.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
@dims dims merged commit 387e703 into google:master Dec 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants