netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: lirongqing@baidu.com
Cc: netdev@vger.kernel.org, pshelar@ovn.org
Subject: Re: [PATCH][net-next] openvswitch: eliminate cpu_used_mask from sw_flow
Date: Sat, 28 Jul 2018 23:12:43 -0700 (PDT)	[thread overview]
Message-ID: <20180728.231243.981858953963997095.davem@davemloft.net> (raw)
In-Reply-To: <1532678637-15079-1-git-send-email-lirongqing@baidu.com>

From: Li RongQing <lirongqing@baidu.com>
Date: Fri, 27 Jul 2018 16:03:57 +0800

> The size of struct cpumask varies with CONFIG_NR_CPUS, some config
> CONFIG_NR_CPUS is very larger, like 5120, struct cpumask will take
> 640 bytes, if there is thousands of flows, it will take lots of
> memory
> 
> cpu_used_mask has two purposes
> 1: Assume first cpu as cpu0 which maybe not true; now use
>    cpumask_first(cpu_possible_mask)
> 2: when get/clear statistic, reduce the iteratation; but it
>    is not hot path, so use for_each_possible_cpu
> 
> Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

This seems to completely undo the optimization done by:

commit c4b2bf6b4a35348fe6d1eb06928eb68d7b9d99a9
Author: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date:   Mon Jul 17 23:28:06 2017 -0700

    openvswitch: Optimize operations for OvS flow_stats.

And in that commit message it states clearly that flow_free()
performance matters, and that the iteration over cpu_possible_mask in
the for() loop is the problem.

At a minimum, we can't apply this unless you explain why the
above performance issue won't be reintroudced by your change.

Thank you.

      parent reply	other threads:[~2018-07-29  7:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  8:03 [PATCH][net-next] openvswitch: eliminate cpu_used_mask from sw_flow Li RongQing
2018-07-28 19:05 ` Pravin Shelar
2018-07-29  6:12 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180728.231243.981858953963997095.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=lirongqing@baidu.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).