From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: act_mirred: remove spinlock in fast path Date: Sat, 18 Jun 2016 11:24:44 -0400 Message-ID: <576567BC.9040201@mojatatu.com> References: <57655062.1080407@mojatatu.com> <1466262966.6850.2.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Eric Dumazet , Cong Wang , David Miller , Linux Kernel Network Developers To: Eric Dumazet Return-path: Received: from mail-io0-f169.google.com ([209.85.223.169]:35600 "EHLO mail-io0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbcFRPY4 (ORCPT ); Sat, 18 Jun 2016 11:24:56 -0400 Received: by mail-io0-f169.google.com with SMTP id f30so91319790ioj.2 for ; Sat, 18 Jun 2016 08:24:51 -0700 (PDT) In-Reply-To: <1466262966.6850.2.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: On 16-06-18 11:16 AM, Eric Dumazet wrote: >> Given an update/replace of an action is such a rare occassion, what >> is wrong with init doing a spin lock on existing action? >> Sure, there is performance impact on fast path at that point - but: >> as established update/replace is _a rare occassion_ ;-> > > The potential 'problem' is not the write side, but the read side. > > If you read say 3 values you might want to read them in a > consistent way, instead of > That part i get. What i meant is: while the fast path is doing rcu_read_lock() of and on the rare occassion that _init() is doing a write to then if it should spin lock it would not corrupt what fast path sees as during the transition. Am i misunderstanding? cheers, jamal