From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] netpoll: allow cleanup to be synchronous Date: Wed, 17 Oct 2018 21:47:05 -0700 (PDT) Message-ID: <20181017.214705.2139316496548022085.davem@davemloft.net> References: <20181012165929.20098-1-dbanerje@akamai.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, nhorman@tuxdriver.com To: dbanerje@akamai.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:54406 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbeJRMqK (ORCPT ); Thu, 18 Oct 2018 08:46:10 -0400 In-Reply-To: <20181012165929.20098-1-dbanerje@akamai.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Debabrata Banerjee Date: Fri, 12 Oct 2018 12:59:29 -0400 > @@ -826,7 +826,10 @@ static void netpoll_async_cleanup(struct work_struct *work) > > void __netpoll_free_async(struct netpoll *np) > { > - schedule_work(&np->cleanup_work); > + if (rtnl_is_locked()) > + __netpoll_cleanup(np); > + else > + schedule_work(&np->cleanup_work); > } rtnl_is_locked() says only that the RTNL mutex is held by someone. It does not necessarily say that it is held by the current execution context. Which means you could erronesly run this synchronously when another thread has the RTNL mutex held, not you. I'm not applying this, sorry.