From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace. Date: Fri, 8 Dec 2017 14:09:12 -0800 Message-ID: References: <1512665148-2413-1-git-send-email-xiangxia.m.yue@gmail.com> <1512665148-2413-2-git-send-email-xiangxia.m.yue@gmail.com> <1512667208.25033.13.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Eric Dumazet , David Miller , Eric Dumazet , Willem de Bruijn , Linux Kernel Network Developers To: Tonghao Zhang Return-path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:38006 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753237AbdLHWJe (ORCPT ); Fri, 8 Dec 2017 17:09:34 -0500 Received: by mail-pg0-f67.google.com with SMTP id f12so7718333pgo.5 for ; Fri, 08 Dec 2017 14:09:33 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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().