[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpVMSYO-sKDkJ+u9=_DxGRsd=vzqnW3Ao3aP0CC6PTm2Kg@mail.gmail.com>
Date: Thu, 13 Dec 2018 15:32:20 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Vlad Buslov <vladbu@...lanox.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>
Subject: Re: [PATCH net-next v2 01/17] net: sched: refactor
mini_qdisc_pair_swap() to use workqueue
On Tue, Dec 11, 2018 at 2:19 AM Vlad Buslov <vladbu@...lanox.com> wrote:
>
> As a part of the effort to remove dependency on rtnl lock, cls API is being
> converted to use fine-grained locking mechanisms instead of global rtnl
> lock. However, chain_head_change callback for ingress Qdisc is a sleeping
> function and cannot be executed while holding a spinlock.
Why does it have to be a spinlock not a mutex?
I've read your cover letter and this changelog, I don't find any answer.
>
> Extend cls API with new workqueue intended to be used for tcf_proto
> lifetime management. Modify tcf_proto_destroy() to deallocate proto
> asynchronously on workqueue in order to ensure that all chain_head_change
> callbacks involving the proto complete before it is freed. Convert
> mini_qdisc_pair_swap(), that is used as a chain_head_change callback for
> ingress and clsact Qdiscs, to use a workqueue. Move Qdisc deallocation to
> tc_proto_wq ordered workqueue that is used to destroy tcf proto instances.
> This is necessary to ensure that Qdisc is destroyed after all instances of
> chain/proto that it contains in order to prevent use-after-free error in
> tc_chain_notify_delete().
Please avoid async unless you have to, there are almost always bugs
when playing with deferred workqueue or any other callbacks.
Thanks.
Powered by blists - more mailing lists