From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35F2AA00E6 for ; Wed, 7 Aug 2019 08:21:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A8F93257; Wed, 7 Aug 2019 08:21:16 +0200 (CEST) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id 70E2F2E8F for ; Wed, 7 Aug 2019 08:21:14 +0200 (CEST) Received: by mail-vs1-f65.google.com with SMTP id v6so60009599vsq.4 for ; Tue, 06 Aug 2019 23:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ipQcG+0CtgZtVwe2LkNEg8V/skAGKaPtaL5DX8mIW/w=; b=iqXzisIfOlvPpG9JV6mN7JQPHg9PARw1lvOLkNUwSRt/N3jTzMldWO38ndaLRu1xI6 eMPSUNcpdTK5HMrYeT4Qz4RuKMKiWSHoDM/rxLv5975y9lEcYpUm47/E5DBcfCbGksiA 95gFHHFgZPlhi6QSf9YsPBTGLAGDhmiTSX803YHKrudo0Ukk/zvjHNAMGjC1jLlninSn 0frb3mp5vYOwKtlUGoePBZHiusXFD+xEzgkgAZPTD2NSBBswoWd14+QX2RMWfq96b2T2 AdxVlszD+1JbkCBdx2m7XO338CVFxkLu8JJgHy5tqn41r1OgTazY3KfajSIlyJwNIb+/ Pfdw== X-Gm-Message-State: APjAAAW/RnuekAPwp2ZyIHghlvRBbkK4yZkuZgoMjQfEoa9AFhO2OVdE SHDzofnAz3nCFW2X4kbPzilLc80fPq+YdtejVnuBjjpaHMA= X-Google-Smtp-Source: APXvYqwnDngBeDa9pUURySTZuphDwNF07TrLFrR+GAy5LvEAzULzHfSXHdp+4esGtt9HQcdbN+R8Q/HX1k2Q9A3UDuQ= X-Received: by 2002:a67:d81b:: with SMTP id e27mr5052853vsj.198.1565158873730; Tue, 06 Aug 2019 23:21:13 -0700 (PDT) MIME-Version: 1.0 References: <1565187236-22545-1-git-send-email-nitin.katiyar@ericsson.com> In-Reply-To: <1565187236-22545-1-git-send-email-nitin.katiyar@ericsson.com> From: David Marchand Date: Wed, 7 Aug 2019 08:21:02 +0200 Message-ID: To: Nitin Katiyar Cc: dev , Anju Thomas Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] Do RCU synchronization at fixed interval in PMD main loop. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello Nitin, On Wed, Aug 7, 2019 at 8:13 AM Nitin Katiyar wrote: > > Each PMD updates the global sequence number for RCU synchronization > purpose with other OVS threads. This is done at every 1025th iteration > in PMD main loop. > > If the PMD thread is responsible for polling large number of queues > that are carrying traffic, it spends a lot of time processing packets > and this results in significant delay in performing the housekeeping > activities. > > If the OVS main thread is waiting to synchronize with the PMD threads > and if those threads delay performing housekeeping activities for > more than 3 sec then LACP processing will be impacted and it will lead > to LACP flaps. Similarly, other controls protocols run by OVS main > thread are impacted. > > For e.g. a PMD thread polling 200 ports/queues with average of 1600 > processing cycles per packet with batch size of 32 may take 10240000 > (200 * 1600 * 32) cycles per iteration. In system with 2.0 GHz CPU > it means more than 5 ms per iteration. So, for 1024 iterations to > complete it would be more than 5 seconds. > > This gets worse when there are PMD threads which are less loaded. > It reduces possibility of getting mutex lock in ovsrcu_try_quiesce() > by heavily loaded PMD and next attempt to quiesce would be after 1024 > iterations. > > With this patch, PMD RCU synchronization will be performed after fixed > interval instead after a fixed number of iterations. This will ensure > that even if the packet processing load is high the RCU synchronization > will not be delayed long. > > Signed-off-by: Anju Thomas > Signed-off-by: Nitin Katiyar > --- > lib/dpif-netdev-perf.c | 16 ---------------- > lib/dpif-netdev-perf.h | 17 +++++++++++++++++ > lib/dpif-netdev.c | 27 +++++++++++++++++++++++++++ > 3 files changed, 44 insertions(+), 16 deletions(-) s/To: dev@dpdk.org/To: dev@openvswitch.org/ -- David Marchand