netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Chris Mi <chrism@mellanox.com>
Cc: netdev@vger.kernel.org, gerlitz.or@gmail.com,
	stephen@networkplumber.org, dsahern@gmail.com,
	marcelo.leitner@gmail.com
Subject: Re: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode
Date: Fri, 5 Jan 2018 18:25:23 +0100	[thread overview]
Message-ID: <20180105172523.GD14358@orbyte.nwl.cc> (raw)
In-Reply-To: <20180104073454.11867-1-chrism@mellanox.com>

Hi Chris,

On Thu, Jan 04, 2018 at 04:34:51PM +0900, Chris Mi wrote:
> Currently in tc batch mode, only one command is read from the batch
> file and sent to kernel to process. With this patchset, we can accumulate
> several commands before sending to kernel. The batch size is specified
> using option -bs or -batchsize.
> 
> To accumulate the commands in tc, client should allocate an array of
> struct iovec. If batchsize is bigger than 1, only after the client
> has accumulated enough commands, can the client call rtnl_talk_msg
> to send the message that includes the iov array. One exception is
> that there is no more command in the batch file.
> 
> But please note that kernel still processes the requests one by one.
> To process the requests in parallel in kernel is another effort.
> The time we're saving in this patchset is the user mode and kernel mode
> context switch. So this patchset works on top of the current kernel.
> 
> Using the following script in kernel, we can generate 1,000,000 rules.
> 	tools/testing/selftests/tc-testing/tdc_batch.py
> 
> Without this patchset, 'tc -b $file' exection time is:
> 
> real    0m15.555s
> user    0m7.211s
> sys     0m8.284s
> 
> With this patchset, 'tc -b $file -bs 10' exection time is:
> 
> real    0m13.043s
> user    0m6.479s
> sys     0m6.504s
> 
> The insertion rate is improved more than 10%.

Did you measure the effect of increasing batch sizes?

I wonder whether specifying the batch size is necessary at all. Couldn't
batch mode just collect messages until either EOF or an incompatible
command is encountered which then triggers a commit to kernel? This
might simplify code quite a bit.

Cheers, Phil

  parent reply	other threads:[~2018-01-05 17:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04  7:34 [patch iproute2 v6 0/3] tc: Add -bs option to batch mode Chris Mi
2018-01-04  7:34 ` [patch iproute2 v6 1/3] lib/libnetlink: Add a function rtnl_talk_msg Chris Mi
2018-01-05 17:50   ` David Ahern
2018-01-09  6:44     ` Chris Mi
2018-01-04  7:34 ` [patch iproute2 v6 2/3] tc: Add -bs option to batch mode Chris Mi
2018-01-05 14:03   ` Marcelo Ricardo Leitner
2018-01-05 18:15   ` David Ahern
2018-01-05 19:14     ` Marcelo Ricardo Leitner
2018-01-09  6:45       ` Chris Mi
2018-01-04  7:34 ` [patch iproute2 v6 3/3] man: Add -bs option to tc manpage Chris Mi
2018-01-05 12:20   ` Marcelo Ricardo Leitner
2018-01-05 17:25 ` Phil Sutter [this message]
2018-01-05 17:27   ` [patch iproute2 v6 0/3] tc: Add -bs option to batch mode David Ahern
2018-01-05 18:45     ` Marcelo Ricardo Leitner
2018-01-08  2:03   ` Chris Mi
2018-01-08  4:00     ` David Ahern
2018-01-08  8:00       ` Chris Mi
2018-01-08 15:40         ` Stephen Hemminger
2018-01-09  1:49           ` Chris Mi
2018-01-08 13:31     ` Phil Sutter
2018-01-09  1:21       ` Chris Mi
2018-01-09  2:35       ` Chris Mi

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=20180105172523.GD14358@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=chrism@mellanox.com \
    --cc=dsahern@gmail.com \
    --cc=gerlitz.or@gmail.com \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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).