[{"id":1794606,"web_url":"http://patchwork.ozlabs.org/comment/1794606/","msgid":"<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>","list_archive_url":null,"date":"2017-10-27T04:05:03","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":2404,"url":"http://patchwork.ozlabs.org/api/people/2404/","name":"Eric Dumazet","email":"eric.dumazet@gmail.com"},"content":"On Thu, 2017-10-26 at 18:24 -0700, Cong Wang wrote:\n> ...\n\n> On the other hand, this makes tcf_block_put() ugly and\n> harder to understand. Since David and Eric strongly dislike\n> adding synchronize_rcu(), this is probably the only\n> solution that could make everyone happy.\n\n\n...\n\n> +static void tcf_block_put_deferred(struct work_struct *work)\n> +{\n> +\tstruct tcf_block *block = container_of(work, struct tcf_block, work);\n> +\tstruct tcf_chain *chain;\n>  \n> +\trtnl_lock();\n>  \t/* Hold a refcnt for all chains, except 0, in case they are gone. */\n>  \tlist_for_each_entry(chain, &block->chain_list, list)\n>  \t\tif (chain->index)\n> @@ -292,13 +308,27 @@ void tcf_block_put(struct tcf_block *block)\n>  \tlist_for_each_entry(chain, &block->chain_list, list)\n>  \t\ttcf_chain_flush(chain);\n>  \n> -\t/* Wait for RCU callbacks to release the reference count. */\n> +\tINIT_WORK(&block->work, tcf_block_put_final);\n> +\t/* Wait for RCU callbacks to release the reference count and make\n> +\t * sure their works have been queued before this.\n> +\t */\n>  \trcu_barrier();\n> +\ttcf_queue_work(&block->work);\n> +\trtnl_unlock();\n> +}\n\n\nOn a loaded server, rcu_barrier() typically takes 4 ms.\n\nWay better than synchronize_rcu() (about 90 ms) but still an issue when\nholding RTNL.\n\nWe have thousands of filters, and management daemon restarts and rebuild\nTC hierarchy from scratch.\n\nSimply getting rid of 1000 old filters might block RTNL for a while, or\nmaybe I misunderstood your patches.\n\nThanks.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"e6LYRQ3Z\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNVdg3J5tz9t2x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:05:11 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751167AbdJ0EFH (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 00:05:07 -0400","from mail-pf0-f195.google.com ([209.85.192.195]:54819 \"EHLO\n\tmail-pf0-f195.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750790AbdJ0EFG (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 00:05:06 -0400","by mail-pf0-f195.google.com with SMTP id n89so4029876pfk.11\n\tfor <netdev@vger.kernel.org>; Thu, 26 Oct 2017 21:05:06 -0700 (PDT)","from [192.168.86.171] (c-67-180-167-114.hsd1.ca.comcast.net.\n\t[67.180.167.114]) by smtp.googlemail.com with ESMTPSA id\n\tt25sm11340712pfh.67.2017.10.26.21.05.03\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 26 Oct 2017 21:05:04 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=message-id:subject:from:to:cc:date:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=OAdrf3OxrMOeFOXqzDjZSfoHanebk3ashgr/M8D547c=;\n\tb=e6LYRQ3ZsTmYBEYqRYh+oQcbfcHo8LatjVXg5Eiy5ZDbQpSf4R0HS4hkCQYMD6YuYp\n\t/azOtoyPd3mhKJNEjgpTpT850qjIWNzk9K3BbEEy6O9HDE4TpznRkR1BIQ1ULdH5tyqF\n\t2b6hoCiQJayUJqYMXcwEGD/rKgikc4VbW2wwy6tiUMZ4gvcgfTzUnA+YE+qD+7kSur+T\n\tk7rDjty8L5Rs/3YPDu3RPETJPP5qxNCBKLYmQyQOwsfwB8dYg/oAP3kEPDL6RmiAMDC+\n\tSYwrfPFw0HVokb9iQ4d1sTdrj3T4Pe4xxJIMWMfVpnAmMxVGm0KgWd//p/AjcFHMxV8+\n\t5Frg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=OAdrf3OxrMOeFOXqzDjZSfoHanebk3ashgr/M8D547c=;\n\tb=S7Z9Hvb1IXk9JkJSylI87nopcBlO8NSHiLywns0oX32ww/NIOzc9+nDh1kgZKCjnkJ\n\tlblcaZNn4cQxOdRKgOfy4qcDV9mtW5LCeXYgAk0HEyzxgPTOXw+8q15O70yjHhFgxmuk\n\tubKtzIaqlylMtEaIIauYUWkUOUqGzqfsT0ByZ+fjPU89TC6JHc9zUlWPTUB/OmdZ+oZ5\n\tbNWKIUIrouDe1f1IxAeAJ0h96xZ+tr3OToaZ9L5hRMzxZW40/gWZfFGllB55Or89bjp3\n\t/NvcoU5cX4IbQAxMl8D6BeugY1vvMl1flaH/fuH+evAhJngxU7VFQfDQzw8m2jXVExnM\n\t9wIA==","X-Gm-Message-State":"AMCzsaXguIu8SEyFFgZZfmeC5TaGnhFHpQ8mycExiODBwGYrPUDzjQ/0\n\tN+ShVecNqCBUDofameDkUbA1fQ==","X-Google-Smtp-Source":"ABhQp+Q08KwRYBUGWq79K3l4OKSBACOy/6UaEcFvLy8ZKf5r3C8kG5Kyw8VDhiYKwKgYWxmRE5MoEg==","X-Received":"by 10.101.83.70 with SMTP id w6mr6760213pgr.361.1509077106174;\n\tThu, 26 Oct 2017 21:05:06 -0700 (PDT)","Message-ID":"<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","From":"Eric Dumazet <eric.dumazet@gmail.com>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"netdev@vger.kernel.org, Chris Mi <chrism@mellanox.com>,\n\tDaniel Borkmann <daniel@iogearbox.net>, Jiri Pirko <jiri@resnulli.us>,\n\tJohn Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\t\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Date":"Thu, 26 Oct 2017 21:05:03 -0700","In-Reply-To":"<20171027012443.3306-2-xiyou.wangcong@gmail.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.10.4-0ubuntu2 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1794611,"web_url":"http://patchwork.ozlabs.org/comment/1794611/","msgid":"<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>","list_archive_url":null,"date":"2017-10-27T04:28:01","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Thu, Oct 26, 2017 at 9:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> On Thu, 2017-10-26 at 18:24 -0700, Cong Wang wrote:\n>> ...\n>\n>> On the other hand, this makes tcf_block_put() ugly and\n>> harder to understand. Since David and Eric strongly dislike\n>> adding synchronize_rcu(), this is probably the only\n>> solution that could make everyone happy.\n>\n>\n> ...\n>\n>> +static void tcf_block_put_deferred(struct work_struct *work)\n>> +{\n>> +     struct tcf_block *block = container_of(work, struct tcf_block, work);\n>> +     struct tcf_chain *chain;\n>>\n>> +     rtnl_lock();\n>>       /* Hold a refcnt for all chains, except 0, in case they are gone. */\n>>       list_for_each_entry(chain, &block->chain_list, list)\n>>               if (chain->index)\n>> @@ -292,13 +308,27 @@ void tcf_block_put(struct tcf_block *block)\n>>       list_for_each_entry(chain, &block->chain_list, list)\n>>               tcf_chain_flush(chain);\n>>\n>> -     /* Wait for RCU callbacks to release the reference count. */\n>> +     INIT_WORK(&block->work, tcf_block_put_final);\n>> +     /* Wait for RCU callbacks to release the reference count and make\n>> +      * sure their works have been queued before this.\n>> +      */\n>>       rcu_barrier();\n>> +     tcf_queue_work(&block->work);\n>> +     rtnl_unlock();\n>> +}\n>\n>\n> On a loaded server, rcu_barrier() typically takes 4 ms.\n>\n> Way better than synchronize_rcu() (about 90 ms) but still an issue when\n> holding RTNL.\n>\n> We have thousands of filters, and management daemon restarts and rebuild\n> TC hierarchy from scratch.\n>\n> Simply getting rid of 1000 old filters might block RTNL for a while, or\n> maybe I misunderstood your patches.\n>\n\nPaul pointed out the same.\n\nAs I replied, this rcu_barrier() is NOT added by this patchset, it is already\nthere in current master branch.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"mls5edHG\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNW8X3Pphz9t2d\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:28:28 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751158AbdJ0E2X (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 00:28:23 -0400","from mail-pf0-f193.google.com ([209.85.192.193]:54327 \"EHLO\n\tmail-pf0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750795AbdJ0E2W (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 00:28:22 -0400","by mail-pf0-f193.google.com with SMTP id n89so4068870pfk.11\n\tfor <netdev@vger.kernel.org>; Thu, 26 Oct 2017 21:28:22 -0700 (PDT)","by 10.100.170.205 with HTTP; Thu, 26 Oct 2017 21:28:01 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=HvE5V2YV4BFa17hMXnMvKjy5sY+Vw9dGizaGQdztsZ8=;\n\tb=mls5edHGYIgTr/nYoRpnzOtzijFcBWWL+UspUb+JWSqNne6DtvV1JRFvGUqb26sCPN\n\tsgz5Qgfrfh90rvHzfqYM6UaSn9I6j86Ylnc3ETnuMfSNbnjJsB3lYNsJe2NNkCF36UGd\n\tveN72aSajGtSoYqwk6IfUVeRaHi5bL2CjgMB2oQo7Ly7HKzaKH3Of7K9eBICtZQRZPTj\n\tEdiTfel2lSS4wg0hAClZtk3+IlbSP1R10h+zvbaUeKYeN2ujEocpYxHmvbhsdzuBEQwm\n\tbeNS38b3WBtKE+PzEL+zMOleS6t/E6knEYohhSCVpM4WnwVw0LXGI5fCfrxRQFLpvaH/\n\tmeBg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=HvE5V2YV4BFa17hMXnMvKjy5sY+Vw9dGizaGQdztsZ8=;\n\tb=tGR0iiATp7LqWb8z1RhDjsh8lyx9vwCkn46GHCSUFUfaFJpp/J3qOok4uKaOqsnQ+A\n\tY8uCn36zObl3k1xni/7ZglyTcDhYCv4ajr+CIIht0fK3GmqscfrUCc+5m/ixT9CYeM/m\n\tuu3jAc+ANNRKJUv2O+ywEp5GxBRYuIKc6DQmXGHXRxpqKBLTA7finoZ4kxV7ZtuNEfOY\n\tJSyUNY8/JNaSGPdjZGpiYDrQ9vvsa77r26uMF7qwRI0E/FYjI44O6B30KCGga5tonFEv\n\t+5PsO/lZOwAFtuNgfjGs2p/NUHXzG/Pj8YIkO4JPEyPQJwixiFh02HJraAjsO+SLqG8G\n\t6GCg==","X-Gm-Message-State":"AMCzsaUdHBQBFS3xS9VUOlUjyPJozXxhgDv0pia9M4jpTUiO824p5xHQ\n\t78RExK98qhPKvAz4pcJdRwnfv6MKRz7HEysRuuvKWg==","X-Google-Smtp-Source":"ABhQp+RK4D6lP1CQo0eilIF8YqfwZUkTGanuq7fT6brFxE2cDWotrLEaCEqIHIq4jLO8FqL84T4lc4OHpl6z+tPNyQM=","X-Received":"by 10.84.253.23 with SMTP id z23mr6029781pll.210.1509078501870; \n\tThu, 26 Oct 2017 21:28:21 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Thu, 26 Oct 2017 21:28:01 -0700","Message-ID":"<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","To":"Eric Dumazet <eric.dumazet@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\t\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1794613,"web_url":"http://patchwork.ozlabs.org/comment/1794613/","msgid":"<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","list_archive_url":null,"date":"2017-10-27T04:39:26","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":2404,"url":"http://patchwork.ozlabs.org/api/people/2404/","name":"Eric Dumazet","email":"eric.dumazet@gmail.com"},"content":"On Thu, 2017-10-26 at 21:28 -0700, Cong Wang wrote:\n> On Thu, Oct 26, 2017 at 9:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> > On Thu, 2017-10-26 at 18:24 -0700, Cong Wang wrote:\n> >> ...\n> >\n> >> On the other hand, this makes tcf_block_put() ugly and\n> >> harder to understand. Since David and Eric strongly dislike\n> >> adding synchronize_rcu(), this is probably the only\n> >> solution that could make everyone happy.\n> >\n> >\n> > ...\n> >\n> >> +static void tcf_block_put_deferred(struct work_struct *work)\n> >> +{\n> >> +     struct tcf_block *block = container_of(work, struct tcf_block, work);\n> >> +     struct tcf_chain *chain;\n> >>\n> >> +     rtnl_lock();\n> >>       /* Hold a refcnt for all chains, except 0, in case they are gone. */\n> >>       list_for_each_entry(chain, &block->chain_list, list)\n> >>               if (chain->index)\n> >> @@ -292,13 +308,27 @@ void tcf_block_put(struct tcf_block *block)\n> >>       list_for_each_entry(chain, &block->chain_list, list)\n> >>               tcf_chain_flush(chain);\n> >>\n> >> -     /* Wait for RCU callbacks to release the reference count. */\n> >> +     INIT_WORK(&block->work, tcf_block_put_final);\n> >> +     /* Wait for RCU callbacks to release the reference count and make\n> >> +      * sure their works have been queued before this.\n> >> +      */\n> >>       rcu_barrier();\n> >> +     tcf_queue_work(&block->work);\n> >> +     rtnl_unlock();\n> >> +}\n> >\n> >\n> > On a loaded server, rcu_barrier() typically takes 4 ms.\n> >\n> > Way better than synchronize_rcu() (about 90 ms) but still an issue when\n> > holding RTNL.\n> >\n> > We have thousands of filters, and management daemon restarts and rebuild\n> > TC hierarchy from scratch.\n> >\n> > Simply getting rid of 1000 old filters might block RTNL for a while, or\n> > maybe I misunderstood your patches.\n> >\n> \n> Paul pointed out the same.\n> \n> As I replied, this rcu_barrier() is NOT added by this patchset, it is already\n> there in current master branch.\n\nYou added the rtnl_lock()  rtnl_unlock()...\n\nI really do not care if hundreds of tasks (not owning rtnl) call\nrcu_barrier()...\n\nAlso we are still using a 4.3 based kernel, and no rcu_barrier() is used\nin filters dismantle ( unregister_tcf_proto_ops() is not used in our\nworkloads )\n\nSomehow something went very wrong in net/sched in recent kernels.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"JmFuHG7M\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNWPP0GP3z9t2W\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 15:39:37 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751230AbdJ0Eja (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 00:39:30 -0400","from mail-pg0-f65.google.com ([74.125.83.65]:51981 \"EHLO\n\tmail-pg0-f65.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750795AbdJ0Ej2 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 00:39:28 -0400","by mail-pg0-f65.google.com with SMTP id p9so4387783pgc.8\n\tfor <netdev@vger.kernel.org>; Thu, 26 Oct 2017 21:39:28 -0700 (PDT)","from [192.168.86.171] (c-67-180-167-114.hsd1.ca.comcast.net.\n\t[67.180.167.114]) by smtp.googlemail.com with ESMTPSA id\n\tx27sm13558117pfe.172.2017.10.26.21.39.26\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 26 Oct 2017 21:39:27 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=message-id:subject:from:to:cc:date:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=W243eN7eTdY2HLdk+179TGkoIiqdHNTXQ3nBv0IZcvM=;\n\tb=JmFuHG7M6xX9/byrSQPX7X1Zk8PozR+Hip7Vc+rrp2VAivhgUqZzgW3FZeM+G8zggl\n\tuWlzREdYVcIMnfFbPghNZLMBPAFHXRG/BK2cEHwr4DxZK4m1IeqQ5A3cu/kuxqTg5GE2\n\tuCMTqiWTltHPEbDAVH95D2awDtpHNWOGUXybA3EOh0hJxVGlAgU13R+UqCrzwMVh8L7z\n\tOhvK9uoYGTBvb+E0Tepa0qSTuZWOo2DNtJrtrUNIw5XpI/RWIEkillQy87nvH+AhsKS5\n\twGFnRtuFo82yNzfZFbi1b0gfZDn4IgZScxdDJFOLS4JTcgyaQdSZy7PLej9icWfdLNYH\n\tPk2g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=W243eN7eTdY2HLdk+179TGkoIiqdHNTXQ3nBv0IZcvM=;\n\tb=CovQkt8ZVPlbQNDoTICn4yWohfjh809sWHVIhzYZyb+C/AYGhOJiVi6YXDWa6JCeZJ\n\tK3Qykv2ZWD7YrsvNQ30KB7WQ7nlUG9DGKh/o4JFCKXcPsxsarD21k6aaRTeN9rEWUg6+\n\tNbmeTsi/TvRs0YmoOlYJWAsdjTSMhLOyVWBuj2c8313TDi5nTe1NkwA7sNqa4/VmP6de\n\ta1WSx70tDiAKbjy7Gn6/rRuFZFGY01iVw6Q9kNsKPCQqtfydxfT/D/o5snHvdExJarjn\n\tXM8GynYEbyehIBucOyAYeDSbfMWOiddb/MbZO8Au5Qh8xzm4ih41MbVTL6WAxexZV9j5\n\tL4ww==","X-Gm-Message-State":"AMCzsaX9s5K3YPqK+qFxyacKzI8uAaZFLpQDWCWOAmP68XIyKOBij3Nl\n\t/IhdTC3ofI2wujbq3Yqg0nE=","X-Google-Smtp-Source":"ABhQp+SvqiKm/0RC7ip14+NqiJUT9Q/0B4KwJpSDptMUNQP1pGkzt1y7DwV+plkPZhSwVywGDbbddg==","X-Received":"by 10.101.64.70 with SMTP id h6mr6960027pgp.144.1509079168116;\n\tThu, 26 Oct 2017 21:39:28 -0700 (PDT)","Message-ID":"<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","From":"Eric Dumazet <eric.dumazet@gmail.com>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\t\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Date":"Thu, 26 Oct 2017 21:39:26 -0700","In-Reply-To":"<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.10.4-0ubuntu2 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1794798,"web_url":"http://patchwork.ozlabs.org/comment/1794798/","msgid":"<20171027115550.GG3659@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-10-27T11:55:50","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":81,"url":"http://patchwork.ozlabs.org/api/people/81/","name":"Paul E. McKenney","email":"paulmck@linux.vnet.ibm.com"},"content":"On Thu, Oct 26, 2017 at 09:39:26PM -0700, Eric Dumazet wrote:\n> On Thu, 2017-10-26 at 21:28 -0700, Cong Wang wrote:\n> > On Thu, Oct 26, 2017 at 9:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> > > On Thu, 2017-10-26 at 18:24 -0700, Cong Wang wrote:\n> > >> ...\n> > >\n> > >> On the other hand, this makes tcf_block_put() ugly and\n> > >> harder to understand. Since David and Eric strongly dislike\n> > >> adding synchronize_rcu(), this is probably the only\n> > >> solution that could make everyone happy.\n> > >\n> > >\n> > > ...\n> > >\n> > >> +static void tcf_block_put_deferred(struct work_struct *work)\n> > >> +{\n> > >> +     struct tcf_block *block = container_of(work, struct tcf_block, work);\n> > >> +     struct tcf_chain *chain;\n> > >>\n> > >> +     rtnl_lock();\n> > >>       /* Hold a refcnt for all chains, except 0, in case they are gone. */\n> > >>       list_for_each_entry(chain, &block->chain_list, list)\n> > >>               if (chain->index)\n> > >> @@ -292,13 +308,27 @@ void tcf_block_put(struct tcf_block *block)\n> > >>       list_for_each_entry(chain, &block->chain_list, list)\n> > >>               tcf_chain_flush(chain);\n> > >>\n> > >> -     /* Wait for RCU callbacks to release the reference count. */\n> > >> +     INIT_WORK(&block->work, tcf_block_put_final);\n> > >> +     /* Wait for RCU callbacks to release the reference count and make\n> > >> +      * sure their works have been queued before this.\n> > >> +      */\n> > >>       rcu_barrier();\n> > >> +     tcf_queue_work(&block->work);\n> > >> +     rtnl_unlock();\n> > >> +}\n> > >\n> > >\n> > > On a loaded server, rcu_barrier() typically takes 4 ms.\n> > >\n> > > Way better than synchronize_rcu() (about 90 ms) but still an issue when\n> > > holding RTNL.\n> > >\n> > > We have thousands of filters, and management daemon restarts and rebuild\n> > > TC hierarchy from scratch.\n> > >\n> > > Simply getting rid of 1000 old filters might block RTNL for a while, or\n> > > maybe I misunderstood your patches.\n> > >\n> > \n> > Paul pointed out the same.\n> > \n> > As I replied, this rcu_barrier() is NOT added by this patchset, it is already\n> > there in current master branch.\n> \n> You added the rtnl_lock()  rtnl_unlock()...\n> \n> I really do not care if hundreds of tasks (not owning rtnl) call\n> rcu_barrier()...\n> \n> Also we are still using a 4.3 based kernel, and no rcu_barrier() is used\n> in filters dismantle ( unregister_tcf_proto_ops() is not used in our\n> workloads )\n> \n> Somehow something went very wrong in net/sched in recent kernels.\n\nWould this be a good time for me to repeat my suggestion that timers\nbe used to aggregate the work done in the workqueue handlers, thus\ndecreasing the number of rcu_barrier() calls done under RTNL?\n\n\t\t\t\t\t\t\tThanx, Paul","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNj5J1YW0z9t2W\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 27 Oct 2017 22:56:20 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752430AbdJ0L4R (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 07:56:17 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33200 \"EHLO\n\tmx0a-001b2d01.pphosted.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1752190AbdJ0L4O (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 07:56:14 -0400","from pps.filterd (m0098409.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv9RBu4Mr030712\n\tfor <netdev@vger.kernel.org>; Fri, 27 Oct 2017 07:56:14 -0400","from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2dv37039te-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <netdev@vger.kernel.org>; Fri, 27 Oct 2017 07:56:08 -0400","from localhost\n\tby e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <netdev@vger.kernel.org> from <paulmck@linux.vnet.ibm.com>;\n\tFri, 27 Oct 2017 07:55:53 -0400","from b01cxnp23034.gho.pok.ibm.com (9.57.198.29)\n\tby e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 27 Oct 2017 07:55:51 -0400","from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com\n\t[9.57.199.108])\n\tby b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v9RBtoPS40894718; Fri, 27 Oct 2017 11:55:50 GMT","from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 7D76EB2050;\n\tFri, 27 Oct 2017 07:53:04 -0400 (EDT)","from paulmck-ThinkPad-W541 (unknown [9.85.150.194])\n\tby b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 608CAB204D;\n\tFri, 27 Oct 2017 07:53:04 -0400 (EDT)","by paulmck-ThinkPad-W541 (Postfix, from userid 1000)\n\tid 9C95216C196E; Fri, 27 Oct 2017 04:55:50 -0700 (PDT)"],"Date":"Fri, 27 Oct 2017 04:55:50 -0700","From":"\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","To":"Eric Dumazet <eric.dumazet@gmail.com>","Cc":"Cong Wang <xiyou.wangcong@gmail.com>,\n\tLinux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","Reply-To":"paulmck@linux.vnet.ibm.com","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>\n\t<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-TM-AS-GCONF":"00","x-cbid":"17102711-0048-0000-0000-000001FC549D","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007961; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000239; SDB=6.00937190; UDB=6.00472337;\n\tIPR=6.00717452; \n\tBA=6.00005660; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017742;\n\tXFM=3.00000015; UTC=2017-10-27 11:55:53","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17102711-0049-0000-0000-000042FF8D15","Message-Id":"<20171027115550.GG3659@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-10-27_07:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tpriorityscore=1501\n\tmalwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0\n\tclxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0\n\tclassifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1707230000\n\tdefinitions=main-1710270160","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1794996,"web_url":"http://patchwork.ozlabs.org/comment/1794996/","msgid":"<CAM_iQpXFw8NcVLLgErTNP8yCeZY+wv5zXDfveCcb6cHN0u5NyQ@mail.gmail.com>","list_archive_url":null,"date":"2017-10-27T15:37:10","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Thu, Oct 26, 2017 at 9:39 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> On Thu, 2017-10-26 at 21:28 -0700, Cong Wang wrote:\n>> On Thu, Oct 26, 2017 at 9:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n>> Paul pointed out the same.\n>>\n>> As I replied, this rcu_barrier() is NOT added by this patchset, it is already\n>> there in current master branch.\n>\n> You added the rtnl_lock()  rtnl_unlock()...\n\n\nUnfortunately you are wrong again, tcf_block_put() holds RTNL\nin current code as well...\n\n\n>\n> I really do not care if hundreds of tasks (not owning rtnl) call\n> rcu_barrier()...\n>\n\nYou are so welcome to improve current code base, but why keep\nblaming my patchset which neither introduces any rcu_barrier()\nnor any RTNL? Did you even take a look at current master branch?\n\n\n> Also we are still using a 4.3 based kernel, and no rcu_barrier() is used\n> in filters dismantle ( unregister_tcf_proto_ops() is not used in our\n> workloads )\n\n\nMy patchset is unfortunately not based on 4.3, this argument is totally\nnonsense.\n\nAlso, filter block was introduced during v4.13.\n\n\n>\n> Somehow something went very wrong in net/sched in recent kernels.\n>\n\nWhat stops you to optimize current code?","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"DWnf0oQP\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNp0Z6Xw0z9t4X\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 28 Oct 2017 02:37:34 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751873AbdJ0Phc (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 11:37:32 -0400","from mail-pg0-f66.google.com ([74.125.83.66]:46198 \"EHLO\n\tmail-pg0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750851AbdJ0Phb (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 11:37:31 -0400","by mail-pg0-f66.google.com with SMTP id k7so5569415pga.3\n\tfor <netdev@vger.kernel.org>; Fri, 27 Oct 2017 08:37:31 -0700 (PDT)","by 10.100.170.205 with HTTP; Fri, 27 Oct 2017 08:37:10 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=Feywi5616EA7EGfMdf4IJKzKsCn+3sHMw9wmPYx9R1A=;\n\tb=DWnf0oQP9MPteuAHFRLA5jFvc0fr8PRy8iQeScEjOnF6fRbOwimApB0J9H62/xZjH4\n\tUZJkirfUqaz/aHxjSgnHQhEJVz7bvXWHqcLDZ1OjHiYYeWKePlJzTIlsdDHeO8VU3+2m\n\tLonlDebW7MX03Wlcb8quCGYFMp8mZb4370rehefADiTy7eOi/riQTsFiWzlI8h6YRgrK\n\tFKPw5zf0KK4IgRh6bNt/KXjy+tmboufrsJKDDRuJx9xtXCO847v/4gy9r9QUvUpRoTs4\n\tIFEQtNGomZUpch20a57kM6TXg93u6trFY+uACcn4mPjNPxDFeyNCLqNi/8ZQKQR1O48I\n\tDEwQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=Feywi5616EA7EGfMdf4IJKzKsCn+3sHMw9wmPYx9R1A=;\n\tb=OvqbKfhpseOrLceIef2YbALR0tvIkIyXMyokQa3s/TFz6FowXiAvnyluz3e80g5m6J\n\tXjrtvsgPnLAuRe56mNkteCmgHJq5gwgLavC3LkyYebulEJYt25wcBxQuxUle6TemQQCm\n\tqBJ+Xg5ynEQxGwoMkeRM3e1F+W6bHB88W79lMUaXt+gsrpFikgtvsMJq+iHYObRpQBB5\n\t0yQyt8YfnyqnMqDqDK25Ah3T+CJ8aYy0YuNkFYIFHFM7Y/Mciw7/apCEOXL5fLdsws8l\n\tDoC7bF3MJ9zOb60pgqOXFrAyPEh0A7bCVeHVe059U2NdxWyGFCw8v+1Jm4ui1lRFuApU\n\tSgKA==","X-Gm-Message-State":"AMCzsaWDDXO4wn2GEgBlqFc0+r45kS7R9YLPUgwVi6OC9EEBf7Uo1wyf\n\t3M4PtvYd9rbIVZ3uIHKBthqG8eaYim9NeCdsXw4=","X-Google-Smtp-Source":"ABhQp+QHzyP18MdpGb3fdOXPDCZkVaA8z3jiTQQmDRiLu+BnYSaTFhZgtsGAs9p8Wk+keCbeWgCiuHKimKpr4ITMwx8=","X-Received":"by 10.84.253.23 with SMTP id z23mr687260pll.210.1509118650878;\n\tFri, 27 Oct 2017 08:37:30 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>\n\t<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Fri, 27 Oct 2017 08:37:10 -0700","Message-ID":"<CAM_iQpXFw8NcVLLgErTNP8yCeZY+wv5zXDfveCcb6cHN0u5NyQ@mail.gmail.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","To":"Eric Dumazet <eric.dumazet@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\t\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1795002,"web_url":"http://patchwork.ozlabs.org/comment/1795002/","msgid":"<CAM_iQpUxG3Bqkg2HJMjAKGe4Cg8TXCDsdSaHYoF_e7oNwWOmwg@mail.gmail.com>","list_archive_url":null,"date":"2017-10-27T15:43:34","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":211,"url":"http://patchwork.ozlabs.org/api/people/211/","name":"Cong Wang","email":"xiyou.wangcong@gmail.com"},"content":"On Fri, Oct 27, 2017 at 4:55 AM, Paul E. McKenney\n<paulmck@linux.vnet.ibm.com> wrote:\n>\n> Would this be a good time for me to repeat my suggestion that timers\n> be used to aggregate the work done in the workqueue handlers, thus\n> decreasing the number of rcu_barrier() calls done under RTNL?\n>\n\nYes, but not in this patchset. The current code is already so, therefore\nneeds a different patchset.\n\nQuite contrarily, my patchset actually improves it _a little bit_ by moving\nthe second rcu_barrier() in current code base to a workqueue... The\ncontention is same, just that we no longer block tcf_block_put() path\nwith my patchset.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"geKHZ2Pn\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNp800Q0gz9t4X\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 28 Oct 2017 02:44:00 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751742AbdJ0Pn5 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 11:43:57 -0400","from mail-pf0-f193.google.com ([209.85.192.193]:48813 \"EHLO\n\tmail-pf0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751164AbdJ0Pnz (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 11:43:55 -0400","by mail-pf0-f193.google.com with SMTP id b79so5224912pfk.5\n\tfor <netdev@vger.kernel.org>; Fri, 27 Oct 2017 08:43:55 -0700 (PDT)","by 10.100.170.205 with HTTP; Fri, 27 Oct 2017 08:43:34 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=K2senwjMtxtHaa8VraRPpr/5O5yQusPZaYidEC2N5Bk=;\n\tb=geKHZ2PnJnVYLHiZPWiaN/7lTSnG2+89hz8K79b9gRRjfb9NWyms5jw7G2PnizXsPs\n\tArnI5mgLPSsXVY/1eplWp1g50NKmunzHt9QDtif6N1O2Y+bHMpoPesIdC+aD51Fg/w2j\n\tU8Yl6984jkMKyMBV4rH1KLi/9IILe2elqFzBPWP42eYivdknQDYJNE3CeLenPbBj/htI\n\t74eNE/oGPCsVxPQ4nMgmHXUIF1+7Nh+vpEzgE6cGny0Y6qrZue1N+QNWBF3IFQlhC7eg\n\tkP8hOKd8OngnNlunYajZDgmACpWb9nkeJOnFJcD7LhgUe8fH3qimQhfwhSCLpKhokijh\n\toFiQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=K2senwjMtxtHaa8VraRPpr/5O5yQusPZaYidEC2N5Bk=;\n\tb=ochZZsJzvQ+EKgMSBu18ssnXaYsXHTvGh14tqyg8a5lQ251RxF1E2PMDUkn2c9j0hi\n\tf0AcAf/ZSTWwC/Dg5/9TFkZECyYX0zmXth+tntgY/cJkMdGHjnBmEQTuMOzQ3a2f81le\n\trUpUJ/lPSh4NEvqiIY49dXtflwI80LOR8veu+0Hjy5t0xtmqyMJ0CG8217emlHSnhAzn\n\tXLhN+QZ4yleFT8iXhSX4ibSjNdd96MoPijIrRP+aZed516wYVBg+asEtYjF5qNVY6RnU\n\tEDb3nvh9ekG1vk/LJD7JZ+xD/s2UjsdlXkmuMUcnbBxqnNiqhqXG0CPowLc+Yb7+bIGB\n\t5tjw==","X-Gm-Message-State":"AMCzsaWvNY+4LF4ANsKVeYz1Pi+tXOws51/SqMxzc3ApHiN4W6Ej160G\n\tlGt1gGndLxgbjeWlWnZpnUD5dQUkecuJF3wAfJo=","X-Google-Smtp-Source":"ABhQp+S74voRDxfuxKMCUNcv1jNpg1sMj+EywW0Q80SLaH7KoAQ/5zf6c8nJ+Cbc+1qaVMkHF51+UULO++pQDAKp2wM=","X-Received":"by 10.84.253.23 with SMTP id z23mr699714pll.210.1509119034761;\n\tFri, 27 Oct 2017 08:43:54 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20171027115550.GG3659@linux.vnet.ibm.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>\n\t<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<20171027115550.GG3659@linux.vnet.ibm.com>","From":"Cong Wang <xiyou.wangcong@gmail.com>","Date":"Fri, 27 Oct 2017 08:43:34 -0700","Message-ID":"<CAM_iQpUxG3Bqkg2HJMjAKGe4Cg8TXCDsdSaHYoF_e7oNwWOmwg@mail.gmail.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","To":"\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Cc":"Eric Dumazet <eric.dumazet@gmail.com>,\n\tLinux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1795008,"web_url":"http://patchwork.ozlabs.org/comment/1795008/","msgid":"<1509119524.11887.38.camel@edumazet-glaptop3.roam.corp.google.com>","list_archive_url":null,"date":"2017-10-27T15:52:04","subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","submitter":{"id":2404,"url":"http://patchwork.ozlabs.org/api/people/2404/","name":"Eric Dumazet","email":"eric.dumazet@gmail.com"},"content":"On Fri, 2017-10-27 at 08:37 -0700, Cong Wang wrote:\n> On Thu, Oct 26, 2017 at 9:39 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> > On Thu, 2017-10-26 at 21:28 -0700, Cong Wang wrote:\n> >> On Thu, Oct 26, 2017 at 9:05 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:\n> >> Paul pointed out the same.\n> >>\n> >> As I replied, this rcu_barrier() is NOT added by this patchset, it is already\n> >> there in current master branch.\n> >\n> > You added the rtnl_lock()  rtnl_unlock()...\n> \n> \n> Unfortunately you are wrong again, tcf_block_put() holds RTNL\n> in current code as well...\n\nThen current code must be fixed, without adding more crap.\n\n> \n\n> What stops you to optimize current code?\n\nI might be forced to do so, eventually.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"oYL5X9BV\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yNpKQ41v5z9t0F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 28 Oct 2017 02:52:10 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751978AbdJ0PwH (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 27 Oct 2017 11:52:07 -0400","from mail-io0-f193.google.com ([209.85.223.193]:51282 \"EHLO\n\tmail-io0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751029AbdJ0PwG (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 27 Oct 2017 11:52:06 -0400","by mail-io0-f193.google.com with SMTP id b186so13650770iof.8\n\tfor <netdev@vger.kernel.org>; Fri, 27 Oct 2017 08:52:06 -0700 (PDT)","from ?IPv6:2620:15c:2c1:100:452d:51ff:7e81:5957?\n\t([2620:15c:2c1:100:452d:51ff:7e81:5957])\n\tby smtp.googlemail.com with ESMTPSA id\n\tw63sm3463240iof.7.2017.10.27.08.52.04\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 27 Oct 2017 08:52:05 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=message-id:subject:from:to:cc:date:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=JBA5DozQu2WDPLc81qWGU9M34nqx+Gbce5SMqInXpwA=;\n\tb=oYL5X9BVOUShtpTaCPNdmT7sUx7yVbHg2eRVvAFVhv58LT5prkA7cVRNLMTdncvf7D\n\tvHWNNGPw/PNmaKfEbnGTrdhTMhHTAU7HeT28lyqxTo/UhUEnDf2gMErSCaB7S7VYr+mg\n\toHu4TnXwtrLy0ZliP9ZJ9DrRLo5hMRhr4U0iwxCo0pF2jiqoFVZnzsIY46oeSOTyXNs4\n\tVjW6JF2rlK6AOABs/032tgT9Eg4h+qxXmV9skzIaYb2kRcbq1p1LIiF96lyz5xdW01oa\n\tBsU8qbmWhDWfcGcfKLyHNI/r3NdFk4vG4mCRD1LSzlnl8n6XAl19fUMrAD6iJPRP1e4D\n\tUPag==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=JBA5DozQu2WDPLc81qWGU9M34nqx+Gbce5SMqInXpwA=;\n\tb=SwUcvLBEUcOmiUurKVcjHTxqar+qVoCa7ERcUF/RoBxSx6O0+mR4FGP4MrSAu8eNwu\n\t+xiKM4WB055OC0+uqALtnnjU7MYcL2WPCPtusCJgU0QaqQsYBNy0bZ0/Q2EyE7ejI1Q6\n\tGiFmAFMRUiMih+GOkLnavncX6/aGbITxctUnWjx7KK0ztkvdlIMqgnU4rA63S+iIeO5q\n\tzke5AJ9zz3QQzSWeeSdyIEbH3jipWaUrefJG4TWQ2GZEMSd4DwpKClfPipyjwJBS+ESc\n\tbkaxBPH4P5ouQaodaIGYAalZ68m4UfXf/DTO5M0NgTvLQTtl1n+gG1zJuICVQWyymIxn\n\tbNsg==","X-Gm-Message-State":"AMCzsaWUr97z7UgZqQFHfNp5rl6b+HCXWuHAjuY8lpgNchgovrE2Bcul\n\tMVH6z4LuEzyyBLGfFo2WekQ=","X-Google-Smtp-Source":"ABhQp+RaAekiULqCJIRpXNviAQm91pNdcpUtFpg9E5AqRMnF96EgEGvAyyzORcuzLF7ETg/j7s2olQ==","X-Received":"by 10.107.85.8 with SMTP id j8mr1210685iob.54.1509119526237;\n\tFri, 27 Oct 2017 08:52:06 -0700 (PDT)","Message-ID":"<1509119524.11887.38.camel@edumazet-glaptop3.roam.corp.google.com>","Subject":"Re: [Patch net 01/16] net_sched: introduce a workqueue for RCU\n\tcallbacks of tc filter","From":"Eric Dumazet <eric.dumazet@gmail.com>","To":"Cong Wang <xiyou.wangcong@gmail.com>","Cc":"Linux Kernel Network Developers <netdev@vger.kernel.org>,\n\tChris Mi <chrism@mellanox.com>, Daniel Borkmann <daniel@iogearbox.net>,\n\tJiri Pirko <jiri@resnulli.us>, John Fastabend <john.fastabend@gmail.com>,\n\tJamal Hadi Salim <jhs@mojatatu.com>,\n\t\"Paul E. McKenney\" <paulmck@linux.vnet.ibm.com>","Date":"Fri, 27 Oct 2017 08:52:04 -0700","In-Reply-To":"<CAM_iQpXFw8NcVLLgErTNP8yCeZY+wv5zXDfveCcb6cHN0u5NyQ@mail.gmail.com>","References":"<20171027012443.3306-1-xiyou.wangcong@gmail.com>\n\t<20171027012443.3306-2-xiyou.wangcong@gmail.com>\n\t<1509077103.11887.23.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpUB_y5=Pa9z5Vq+Ves9GhT5COXvRbDtRZo2xqxjo__vmw@mail.gmail.com>\n\t<1509079166.11887.33.camel@edumazet-glaptop3.roam.corp.google.com>\n\t<CAM_iQpXFw8NcVLLgErTNP8yCeZY+wv5zXDfveCcb6cHN0u5NyQ@mail.gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-Mailer":"Evolution 3.10.4-0ubuntu2 ","Mime-Version":"1.0","Content-Transfer-Encoding":"7bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]