On Tue, Feb 09, 2021 at 08:42:38PM +0100, Mateusz Guzik wrote: > Things like this are best sorted out with atomic_store, otherwise you > may fall victim of various compiler mischief (even if it happens to be > harmless for the time being). > > iow all ->staleness accesses should be converted to atomic_*. > > grep finds this in ng_bridge_timeout: > > if (++host->staleness >= priv->conf.maxStaleness) { > > the code should probably explain how this is synchronized against said zeroing
There is no risk, because all other access to this variable is done under a WRITER lock of the whole node. Even this one, you are quoting here. The lock comes from the netgraph framework itself. The only remaining access, which can be run in parallel, is the mentioned setting to zero. In order to document all this reasoning the comment was extended. At the moment the ng_bridge(4) node is completely singlethreaded, any call runs under the WRITER lock. The purpose of all the commits and all the open reviews are to remove this limitation in order to give the node a major performance boost. _______________________________________________ dev-commits-src-main@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"