From: Eric Dumazet Subject: Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path Date: Thu, 15 Nov 2018 05:53:46 -0800 Message-ID: <6ef73ea1-2f0e-b1c5-3a0a-1742db67b59a@gmail.com> 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: Davide Caratti , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:47028 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729010AbeKPABp (ORCPT ); Thu, 15 Nov 2018 19:01:45 -0500 Received: by mail-pl1-f193.google.com with SMTP id t13so6564685ply.13 for ; Thu, 15 Nov 2018 05:53:49 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/15/2018 03:43 AM, Davide Caratti wrote: > 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? > SGTM, thanks.