[ovs-dev] [fd leak v2 3/3] dpif-linux: Fix fd leak for vports that disappear from the datapath.
Ben Pfaff
blp at nicira.com
Fri Dec 13 22:52:13 UTC 2013
On Mon, Nov 25, 2013 at 12:49:45PM -0800, Alex Wang wrote:
> LGTM, only one thing,
>
> I did the following test:
>
> """
> root at server329:~/ben-reviews# ovs-vsctl --version
> ovs-vsctl (Open vSwitch) 2.0.90
> Compiled Nov 25 2013 11:44:29
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
>
> 31
> *root at server329:~/ben-reviews# ovs-vsctl add-br test*
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
> 44
> *root at server329:~/ben-reviews# ip link add name foo type veth peer name bar*
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
>
> 44
> *root at server329:~/ben-reviews# ovs-vsctl add-port test foo*
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
> 45
> *root at server329:~/ben-reviews# ip link delete foo*
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
> 43
> *root at server329:~/ben-reviews# **ovs-vsctl del-port foo*
> root at server329:~/ben-reviews# lsof -p `pidof ovs-vswitchd` | wc -l
> 43
> root at server329:~/ben-reviews#
> """
>
>
> After adding the veth, the fd count is incremented by 1. But after
> deleting it, the fd count is decremented by 2. So, seem to me that there
> is other place that can delete the vport but not the channel.
I ran an "strace" with your sample commands. I can see netlink
sockets being opened and closed when I expect, so I think that the
behavior is OK. I see some other activity with fds, and maybe some of
that yields the surprising results.
I think these patches are OK, so I'm going to push them soon.
Thanks,
Ben.
More information about the dev
mailing list