From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [Patch net 2/2] net_sched: hold netns refcnt for each action Date: Fri, 3 Nov 2017 18:15:27 -0700 Message-ID: References: <20171101172350.12842-1-xiyou.wangcong@gmail.com> <20171101172350.12842-3-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Lucas Bates , Cong Wang , Jamal Hadi Salim , Jiri Pirko To: Linux Kernel Network Developers Return-path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:44800 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbdKDBPs (ORCPT ); Fri, 3 Nov 2017 21:15:48 -0400 Received: by mail-pg0-f67.google.com with SMTP id j3so3840997pga.1 for ; Fri, 03 Nov 2017 18:15:48 -0700 (PDT) In-Reply-To: <20171101172350.12842-3-xiyou.wangcong@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Nov 1, 2017 at 10:23 AM, Cong Wang wrote: > TC actions have been destroyed asynchronously for a long time, > previously in a RCU callback and now in a workqueue. If we > don't hold a refcnt for its netns, we could use the per netns > data structure, struct tcf_idrinfo, after it has been freed by > netns workqueue. > > Hold refcnt to ensure netns destroy happens after all actions > are gone. This in fact is wrong. If we hold that refcnt, the netns can never be destroyed until all actions are destroyed by user, this breaks our netns design. I am going to send a revert and a right way to fix it. It is more complicated that I thought due to all of these flying RCU callbacks and workqueue again, sigh... Sorry about it.