On Fri, Dec 8, 2017 at 9:27 PM, Tonghao Zhang wrote:
> On Sat, Dec 9, 2017 at 6:09 AM, Cong Wang wrote:
>> On Thu, Dec 7, 2017 at 9:28 PM, Tonghao Zhang
>> wrote:
>>>
>>> Release the netlink sock created in kernel(not hold the _net_ namespace):
>>>
>>
>> You can avoid counting kernel sock by te
On Sat, Dec 9, 2017 at 6:09 AM, Cong Wang wrote:
> On Thu, Dec 7, 2017 at 9:28 PM, Tonghao Zhang
> wrote:
>>
>> Release the netlink sock created in kernel(not hold the _net_ namespace):
>>
>
> You can avoid counting kernel sock by testing 'kern' in sk_alloc()
> and testing 'sk->sk_net_refcnt' in
On Fri, Dec 8, 2017 at 9:24 PM, Eric Dumazet wrote:
> On Fri, 2017-12-08 at 19:29 +0800, Tonghao Zhang wrote:
>> hi all. we can add synchronize_rcu and rcu_barrier in
>> sock_inuse_exit_net to
>> ensure there are no outstanding rcu callbacks using this network
>> namespace.
>> we will not have to
On Thu, Dec 7, 2017 at 9:28 PM, Tonghao Zhang wrote:
>
> Release the netlink sock created in kernel(not hold the _net_ namespace):
>
You can avoid counting kernel sock by testing 'kern' in sk_alloc()
and testing 'sk->sk_net_refcnt' in __sk_free().
On Fri, 2017-12-08 at 19:29 +0800, Tonghao Zhang wrote:
> hi all. we can add synchronize_rcu and rcu_barrier in
> sock_inuse_exit_net to
> ensure there are no outstanding rcu callbacks using this network
> namespace.
> we will not have to test if net->core.sock_inuse is NULL or not from
> sock_inus
hi all. we can add synchronize_rcu and rcu_barrier in sock_inuse_exit_net to
ensure there are no outstanding rcu callbacks using this network namespace.
we will not have to test if net->core.sock_inuse is NULL or not from
sock_inuse_add(). :)
static void __net_exit sock_inuse_exit_net(struct net
On Fri, Dec 8, 2017 at 1:40 PM, Eric Dumazet wrote:
> On Fri, 2017-12-08 at 13:28 +0800, Tonghao Zhang wrote:
>> On Fri, Dec 8, 2017 at 1:20 AM, Eric Dumazet
>> wrote:
>> > On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote:
>> > > In some case, we want to know how many sockets are in use in
On Fri, 2017-12-08 at 13:28 +0800, Tonghao Zhang wrote:
> On Fri, Dec 8, 2017 at 1:20 AM, Eric Dumazet
> wrote:
> > On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote:
> > > In some case, we want to know how many sockets are in use in
> > > different _net_ namespaces. It's a key resource metri
On Fri, Dec 8, 2017 at 1:20 AM, Eric Dumazet wrote:
> On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote:
>> In some case, we want to know how many sockets are in use in
>> different _net_ namespaces. It's a key resource metric.
>>
>
> ...
>
>> +static void sock_inuse_add(struct net *net, int
On Thu, Dec 7, 2017 at 9:20 AM, Eric Dumazet wrote:
> On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote:
>> In some case, we want to know how many sockets are in use in
>> different _net_ namespaces. It's a key resource metric.
>>
>
> ...
>
>> +static void sock_inuse_add(struct net *net, int
On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote:
> In some case, we want to know how many sockets are in use in
> different _net_ namespaces. It's a key resource metric.
>
...
> +static void sock_inuse_add(struct net *net, int val)
> +{
> + if (net->core.prot_inuse)
> + th
In some case, we want to know how many sockets are in use in
different _net_ namespaces. It's a key resource metric.
This patch add a member in struct netns_core. This is a counter
for socket-inuse in the _net_ namespace. The patch will add/sub
counter in the sk_alloc, sk_clone_lock and __sk_free.
12 matches
Mail list logo