From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next v2] ipv4: fib: Replay events when registering FIB notifier Date: Tue, 01 Nov 2016 07:19:59 -0700 Message-ID: <1478009999.7065.334.camel@edumazet-glaptop3.roam.corp.google.com> References: <1477948427-9189-1-git-send-email-idosch@idosch.org> <1477949046.7065.320.camel@edumazet-glaptop3.roam.corp.google.com> <20161031225737.7nfoy4ka3ydzhptq@splinter> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com, mlxsw@mellanox.com, roopa@cumulusnetworks.com, dsa@cumulusnetworks.com, nikolay@cumulusnetworks.com, andy@greyhouse.net, vivien.didelot@savoirfairelinux.com, andrew@lunn.ch, f.fainelli@gmail.com, alexander.h.duyck@intel.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, Ido Schimmel To: Ido Schimmel Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:34491 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966312AbcKAOUF (ORCPT ); Tue, 1 Nov 2016 10:20:05 -0400 Received: by mail-pf0-f195.google.com with SMTP id y68so5943691pfb.1 for ; Tue, 01 Nov 2016 07:20:05 -0700 (PDT) In-Reply-To: <20161031225737.7nfoy4ka3ydzhptq@splinter> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 2016-11-01 at 00:57 +0200, Ido Schimmel wrote: > On Mon, Oct 31, 2016 at 02:24:06PM -0700, Eric Dumazet wrote: > > How well will this work for large FIB tables ? > > > > Holding rtnl while sending thousands of skb will prevent consumers to > > make progress ? > > Can you please clarify what do you mean by "while sending thousands of > skb"? This patch doesn't generate notifications to user space, but > instead invokes notification routines inside the kernel. I probably > misunderstood you. > > Are you suggesting this be done using RCU instead? Well, there are a > couple of reasons why I took RTNL here: > No, I do not believe RCU is wanted here, in control path where we might sleep anyway. > 1) The FIB notification chain is blocking, so listeners are expected to > be able to sleep. This isn't possible if we use RCU. Note that this > chain is mainly useful for drivers that reflect the FIB table into a > capable device and hardware operations usually involve sleeping. > > 2) The insertion of a single route is done with RTNL held. I didn't want > to differentiate between both cases. This property is really useful for > listeners, as they don't need to worry about locking in writer-side. > Access to data structs is serialized by RTNL. My concern was that for large iterations, you might hold RTNL and/or current cpu for hundred of ms or even seconds...