From mboxrd@z Thu Jan 1 00:00:00 1970 From: Davide Caratti Subject: Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path Date: Thu, 15 Nov 2018 12:43:59 +0100 Message-ID: References: <6d287f706fdcff76eb1e9a1c85ea6ce188db11d8.1536852493.git.dcaratti@redhat.com> <45d88e35-43f8-d9ae-4da4-de61c3591a62@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Eric Dumazet , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728931AbeKOVvb (ORCPT ); Thu, 15 Nov 2018 16:51:31 -0500 In-Reply-To: <45d88e35-43f8-d9ae-4da4-de61c3591a62@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 2018-11-14 at 22:46 -0800, Eric Dumazet wrote: > > On 09/13/2018 10:29 AM, Davide Caratti wrote: > > use RCU instead of spinlocks, to protect concurrent read/write on > > act_police configuration. This reduces the effects of contention in the > > data path, in case multiple readers are present. > > > > Signed-off-by: Davide Caratti > > --- > > net/sched/act_police.c | 156 ++++++++++++++++++++++++----------------- > > 1 file changed, 92 insertions(+), 64 deletions(-) > > > > I must be missing something obvious with this patch. hello Eric, On the opposite, I missed something obvious when I wrote that patch: there is a race condition on tcfp_toks, tcfp_ptoks and tcfp_t_c: thank you for noticing it. These variables still need to be protected with a spinlock. I will do a patch and evaluate if 'act_police' is still faster than a version where 2d550dbad83c ("net/sched: .... ") is reverted, and share results in the next hours. Ok? -- davide