From patchwork Fri May 18 16:55:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 916471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nZ7h4GXLz9s3T for ; Sat, 19 May 2018 02:56:11 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 50FEFA47; Fri, 18 May 2018 16:55:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 0B013899 for ; Fri, 18 May 2018 16:55:43 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 84D27B0 for ; Fri, 18 May 2018 16:55:42 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id f6-v6so15188687wmc.4 for ; Fri, 18 May 2018 09:55:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QDuSfuCPHmsmaVrLHN14M+AT1CiqkB6Dfu/5Lg/5D0U=; b=QF1BaASVcoVExwXTOnSlCkHTdGSE6dXHJNctp7WVt3pcpH1OVYM06kJ97nt14i7mR5 bv+4ALZfEf3d65MxgW2bjBu/+SFMxjoVl2ZSfd4tbMU+zVkqMqF+smNoSJBiLnkwhoXm 51RDcjdjpuRKSVn+dtEp+nAEU1hEnAxtWAoaCpVOGXeBk/87ktP6OUNH+P/cva9JtPR0 OOOXX3kpV2xOY9mSZUcKwgAC7Usn7xSRy6FtxOCi3pcL9Tq1hgaSfE7annEnAKXf5EmV q1eBQSti6Euz7gHY5ELt41PHTLyDAlPLNQpcgME+XEp5/WW+0ibuxzC083EWWqQsJwIY 8/CA== X-Gm-Message-State: ALKqPwesXr2x48dH9d8KRmcGkSE5o9uhUVmVIan+LRPA+7kFtpyWgnFW H0kymL855I76CMdVoj5H5551t8Pr2ZU= X-Google-Smtp-Source: AB8JxZqbc+kaiYe2+nCdDRuCb9+LUWPi1MnZuK2NbfGl/XArRzfA5on1TqEs2E4uuPR9fQQBiwyoRw== X-Received: by 2002:a1c:84cb:: with SMTP id g194-v6mr5574668wmd.8.1526662540880; Fri, 18 May 2018 09:55:40 -0700 (PDT) Received: from redhat.com (170.red-2-136-193.dynamicip.rima-tde.net. [2.136.193.170]) by smtp.gmail.com with ESMTPSA id b105-v6sm9767498wrd.64.2018.05.18.09.55.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 09:55:40 -0700 (PDT) From: Jakub Sitnicki To: dev@openvswitch.org Date: Fri, 18 May 2018 18:55:35 +0200 Message-Id: <20180518165537.32002-2-jkbs@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180518165537.32002-1-jkbs@redhat.com> References: <20180518165537.32002-1-jkbs@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [RFC 1/3] ovn-controller: Count calls to lflow_run() X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org lflow_run() is the main logical flows processing routine that we spend most of the CPU time in when testing at scale. With the switch to incremental processing approach in the controller, we will be trying to avoid calling to lflow_run() as much as possible. A counter lets us confirm that we are doing logical flow processing only when it's expected, without resorting to profiling under stress. It can also serve as a hint as to why ovn-controller process is consuming CPU time. Signed-off-by: Jakub Sitnicki Acked-by: Han Zhou --- ovn/controller/lflow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c index d75e03ffb..171ee102d 100644 --- a/ovn/controller/lflow.c +++ b/ovn/controller/lflow.c @@ -14,6 +14,7 @@ */ #include +#include "coverage.h" #include "gchassis.h" #include "lflow.h" #include "lport.h" @@ -34,6 +35,8 @@ #include "sset.h" VLOG_DEFINE_THIS_MODULE(lflow); + +COVERAGE_DEFINE(lflow_run); /* Symbol table. */ @@ -553,6 +556,8 @@ lflow_run(struct ovn_desired_flow_table *flow_table, struct sset *local_lport_ids, uint32_t *conj_id_ofs) { + COVERAGE_INC(lflow_run); + add_logical_flows(flow_table, ctx, chassis_index, local_datapaths, group_table, meter_table, chassis, addr_sets, port_groups, active_tunnels, local_lport_ids,