[ovs-dev] [PATCH v1 9/9] conntrack: Use an atomic conn expiration value

William Tu u9012063 at gmail.com
Tue Feb 23 22:56:13 UTC 2021


On Wed, Feb 17, 2021 at 8:34 AM Gaetan Rivet <grive at u256.net> wrote:
>
> A lock is taken during conn_lookup() to check whether a connection is
> expired before returning it. This lock can have some contention.
>
> Even though this lock ensures a consistent sequence of writes, it does
> not imply a specific order. A ct_clean thread taking the lock first
> could read a value that would be updated immediately after by a PMD
> waiting on the same lock, just as well as the opposite order.
>
> As such, the expiration time can be stale anytime it is read. In this
> context, using an atomic will ensure the same write consistency while
> keeping the same (lack of) guarantee for reads. Reading the atomic will
> however be less costly than taking and releasing the lock.
>
> Signed-off-by: Gaetan Rivet <grive at u256.net>
> Reviewed-by: Eli Britstein <elibr at nvidia.com>
> ---
LGTM! thanks
Acked-by: William Tu <u9012063 at gmail.com>


More information about the dev mailing list