From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: Re: [PATCH net-next v2] net: sched: change tcf_del_walker() to take idrinfo->lock Date: Wed, 12 Sep 2018 11:50:48 +0300 Message-ID: References: <1536328317-8170-1-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , David Miller To: Cong Wang Return-path: Received: from mail-eopbgr50046.outbound.protection.outlook.com ([40.107.5.46]:32736 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726640AbeILNyg (ORCPT ); Wed, 12 Sep 2018 09:54:36 -0400 In-reply-to: Sender: netdev-owner@vger.kernel.org List-ID: On Fri 07 Sep 2018 at 19:12, Cong Wang wrote: > On Fri, Sep 7, 2018 at 6:52 AM Vlad Buslov wrote: >> >> Action API was changed to work with actions and action_idr in concurrency >> safe manner, however tcf_del_walker() still uses actions without taking a >> reference or idrinfo->lock first, and deletes them directly, disregarding >> possible concurrent delete. >> >> Add tc_action_wq workqueue to action API. Implement >> tcf_idr_release_unsafe() that assumes external synchronization by caller >> and delays blocking action cleanup part to tc_action_wq workqueue. Extend >> tcf_action_cleanup() with 'async' argument to indicate that function should >> free action asynchronously. > > Where exactly is blocking in tcf_action_cleanup()? > > From your code, it looks like free_tcf(), but from my observation, > the only blocking function inside is tcf_action_goto_chain_fini() > which calls __tcf_chain_put(). But, __tcf_chain_put() is blocking > _ONLY_ when tc_chain_notify() is called, for tc action it is never > called. > > So, what else is blocking? __tcf_chain_put() calls tc_chain_tmplt_del(), which calls ops->tmplt_destroy(). This last function uses hw offload API, which is blocking.