[ovs-dev] [PATCH] mirror: Allow concurrent lookups.
Ben Pfaff
blp at ovn.org
Thu Mar 9 00:15:23 UTC 2017
On Tue, Feb 21, 2017 at 07:44:02PM -0800, Jarno Rajahalme wrote:
> Handler threads use a selection of mirror functions with the
> assumption that the data referred to is RCU protected, while the
> implementation has not provided for this, which can lead to an OVS
> crash.
>
> This patch fixes this by making the mbundle lookup RCU-safe by using
> cmap instead of hmap and postponing mbundle memory free, as wells as
> postponing the frees of the mirrors and the vlan bitmaps of each
> mirror.
>
> Note that mirror stats update is still not accurate if multiple
> threads do it simultaneously.
>
> A less complete version of this patch (using cmap and RCU postpone
> just for the mbridge itself) was tested by Yunjian Wang and was found
> to fix the observed crash when running a script that adds and deletes
> a port repeatedly.
>
> Reported-by: Yunjian Wang <wangyunjian at huawei.com>
> Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
The mirror code doesn't give me much confidence regarding concurrency,
even after this patch, but it does seem to be an improvement.
Acked-by: Ben Pfaff <blp at ovn.org>
More information about the dev
mailing list