Re: [PATCH v3 2/2] sock: Move the socket inuse to namespace.

2017-11-16 Thread Tonghao Zhang
On Fri, Nov 17, 2017 at 4:20 AM, Cong Wang wrote: > On Wed, Nov 15, 2017 at 7:36 AM, Tonghao Zhang > wrote: >> diff --git a/net/core/sock.c b/net/core/sock.c >> index b899d8669388..f01ed0b41bde 100644 >> --- a/net/core/sock.c >> +++

Re: [PATCH v3 2/2] sock: Move the socket inuse to namespace.

2017-11-16 Thread Cong Wang
On Wed, Nov 15, 2017 at 7:36 AM, Tonghao Zhang wrote: > diff --git a/net/core/sock.c b/net/core/sock.c > index b899d8669388..f01ed0b41bde 100644 > --- a/net/core/sock.c > +++ b/net/core/sock.c > @@ -145,6 +145,10 @@ > static DEFINE_MUTEX(proto_list_mutex); > static

[PATCH v3 2/2] sock: Move the socket inuse to namespace.

2017-11-15 Thread Tonghao Zhang
From: Tonghao Zhang This patch add a member in struct netns_core. and this is a counter for socket_inuse in the _net_ namespace. The patch will add/sub counter in the sk_alloc or sk_free. Because socket and sock is in pair. It's a easy way to maintain the code. and help