netns refcnt leak for kernel accept sock

2015-07-27 Thread Sowmini Varadhan
I'm running into a netns refcnt issue, and I suspect that eeb1bd5c has something to do with it (perhaps we need an additional change in sk_clone_lock() after eeb1bd5c). Here's the problem: When we create an syn_recv sock based on a kernel listen sock, we take a get_net() ref with a stack

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Sowmini Varadhan
On (07/27/15 12:40), ebied...@xmission.com wrote: sock_create_kern and friends are specialied interfaces for special purposes. At a quick read through I don't think we have a single in tree user doing with them what you are trying to do. That doesnt change the fact that the architecture is

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Eric W. Biederman
sock_create_kern and friends are specialied interfaces for special purposes. At a quick read through I don't think we have a single in tree user doing with them what you are trying to do. Without seeing code using the interfaces in the way are trying to use them I do not have enough information

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Sowmini Varadhan
On (07/27/15 11:13), Cong Wang wrote: That refcnt should be released in sock destructor too, when the tcp connection is terminated. yes, but in my case, the listen socket is opened as part of the -init indirection in pernet_operations (thus it is a kernel socket) and the expectation is that

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Cong Wang
On Mon, Jul 27, 2015 at 7:21 AM, Sowmini Varadhan sowmini.varad...@oracle.com wrote: I'm running into a netns refcnt issue, and I suspect that eeb1bd5c has something to do with it (perhaps we need an additional change in sk_clone_lock() after eeb1bd5c). Here's the problem: When we create an

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Cong Wang
On Mon, Jul 27, 2015 at 11:19 AM, Sowmini Varadhan sowmini.varad...@oracle.com wrote: On (07/27/15 11:13), Cong Wang wrote: That refcnt should be released in sock destructor too, when the tcp connection is terminated. yes, but in my case, the listen socket is opened as part of the -init

Re: netns refcnt leak for kernel accept sock

2015-07-27 Thread Sowmini Varadhan
On (07/27/15 11:37), Cong Wang wrote: dlm uses a kernel TCP socket too, but it allocates a new socket and calls -accept() by itself. ;) sure, and rds does this in rds_tcp_accept_one() too. But the newsk being created in sk_clone_lock is the one on an incoming syn, i.e., the one that is