Page MenuHomeFreeBSD

wg: Use plain loads/stores for keepalive management.
Needs ReviewPublic

Authored by jhb on Fri, Jul 29, 4:57 PM.

Details

Reviewers
markj
Summary

Using atomic loads after NET_EPOCH_ENTER or atomic stores before/after
NET_EPOCH_WAIT are not needed due to the existing barriers inside of
epoch_*().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 46682
Build 43571: arc lint + arc unit

Event Timeline

sys/dev/wg/if_wg.c
1048

I think this is an example of a place where we want to use atomic_load: there's no synchronization with writers so the values being loaded are immediately stale. That's not a problem in itself but it should be made obvious to anyone reading the code.

I wrote an implementation of plain atomic_load/store_bool(), will post it shortly.

What exactly does the net epoch section do for us here?

sys/dev/wg/if_wg.c
960

Hmm, I guess this comment is the reason for the NET_EPOCH around the callout_reset you asked about. It is not clear to me that a per-peer mutex used for managing callouts would be significantly less efficient? It would be easier to understand I think.

1048

I pointed to a comment above. It is abusing the epoch to serialize with the code that disables the peer.