Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com
Cc: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: [spp] [PATCH 11/15] docs: add performance_opt section
Date: Thu,  1 Feb 2018 13:04:57 +0900	[thread overview]
Message-ID: <20180201040501.8004-11-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20180201040501.8004-1-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Add section for performance optimization containing following topics.

* Reduce context switches
* Optimizing QEMU performance

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 docs/guides/setup/index.rst           |   1 +
 docs/guides/setup/performance_opt.rst | 106 ++++++++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+)
 create mode 100644 docs/guides/setup/performance_opt.rst

diff --git a/docs/guides/setup/index.rst b/docs/guides/setup/index.rst
index 972132d..0ac18af 100644
--- a/docs/guides/setup/index.rst
+++ b/docs/guides/setup/index.rst
@@ -38,3 +38,4 @@ Setup Guide
    getting_started
    howto_use
    use_cases
+   performance_opt
diff --git a/docs/guides/setup/performance_opt.rst b/docs/guides/setup/performance_opt.rst
new file mode 100644
index 0000000..2bf8a5e
--- /dev/null
+++ b/docs/guides/setup/performance_opt.rst
@@ -0,0 +1,106 @@
+..  BSD LICENSE
+    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+    * Neither the name of Intel Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Performance Optimization
+========================
+
+Reduce Context Switches
+-----------------------
+
+Use the ``isolcpus`` Linux kernel parameter to isolate them
+from Linux scheduler to reduce context switches.
+It prevents workloads of other processes than DPDK running on
+reserved cores with ``isolcpus`` parameter.
+
+For Ubuntu 16.04, define ``isolcpus`` in ``/etc/default/grub``.
+
+.. code-block:: console
+
+    GRUB_CMDLINE_LINUX_DEFAULT=“isolcpus=0-3,5,7”
+
+The value of this ``isolcpus`` depends on your environment and usage.
+This example reserves six cores(0,1,2,3,5,7).
+
+
+Optimizing QEMU Performance
+---------------------------
+
+QEMU process runs threads for vcpu emulation. It is effective strategy
+for pinning vcpu threads to decicated cores.
+
+To find vcpu threads, you use ``ps`` command to find PID of QEMU process
+and ``pstree`` command for threads launched from QEMU process.
+
+.. code-block:: console
+
+    $ ps ea
+       PID TTY      STAT   TIME COMMAND
+    192606 pts/11   Sl+    4:42 ./x86_64-softmmu/qemu-system-x86_64 -cpu host ...
+
+Run ``pstree`` with ``-p`` and this PID to find all threads launched from QEMU.
+
+.. code-block:: console
+
+    $ pstree -p 192606
+    qemu-system-x86(192606)--+--{qemu-system-x8}(192607)
+                             |--{qemu-system-x8}(192623)
+                             |--{qemu-system-x8}(192624)
+                             |--{qemu-system-x8}(192625)
+                             |--{qemu-system-x8}(192626)
+
+Update affinity by using ``taskset`` command to pin vcpu threads.
+The vcpu threads is listed from the second entry and later.
+In this example, assign PID 192623 to core 4, PID 192624 to core 5
+and so on.
+
+.. code-block:: console
+
+    $ sudo taskset -pc 4 192623
+    pid 192623's current affinity list: 0-31
+    pid 192623's new affinity list: 4
+    $ sudo taskset -pc 5 192624
+    pid 192624's current affinity list: 0-31
+    pid 192624's new affinity list: 5
+    $ sudo taskset -pc 6 192625
+    pid 192625's current affinity list: 0-31
+    pid 192625's new affinity list: 6
+    $ sudo taskset -pc 7 192626
+    pid 192626's current affinity list: 0-31
+    pid 192626's new affinity list: 7
+
+
+Reference
+---------
+
+* [1] `Best pinning strategy for latency/performance trade-off <https://www.redhat.com/archives/vfio-users/2017-February/msg00010.html>`_
+* [2] `PVP reference benchmark setup using testpmd <http://dpdk.org/doc/guides/howto/pvp_reference_benchmark.html>`_
+* [3] `Enabling Additional Functionality <http://dpdk.org/doc/guides/linux_gsg/enable_func.html>`_
+* [4] `How to get best performance with NICs on Intel platforms <http://dpdk.org/doc/guides/linux_gsg/nic_perf_intel_platform.html>`_
-- 
2.7.4

  parent reply	other threads:[~2018-02-01  4:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  4:04 [spp] [PATCH 01/15] docs: add rst docs ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 02/15] docs: add overview ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 03/15] docs: add primary commands ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 04/15] docs: add common commands ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 05/15] docs: add secondary commands ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 06/15] docs: add descriptions for pri commands ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 07/15] docs: fix erata of help command ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 08/15] docs: revise index in setup chapter ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 09/15] docs: update getting_started section ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 10/15] docs: update howto_use section ogawa.yasufumi
2018-02-01  4:04 ` ogawa.yasufumi [this message]
2018-02-01  4:04 ` [spp] [PATCH 12/15] docs: update use_cases section ogawa.yasufumi
2018-02-01  4:04 ` [spp] [PATCH 13/15] docs: update overview section ogawa.yasufumi
2018-02-01  4:05 ` [spp] [PATCH 14/15] docs: add compile script for rst documentation ogawa.yasufumi
2018-02-01  4:05 ` [spp] [PATCH 15/15] makefile: add target for compile rst documents ogawa.yasufumi
2018-02-05  2:34 ` [spp] [PATCH 01/15] docs: add rst docs Yasufumi Ogawa
2018-02-06 15:22   ` Ferruh Yigit

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=20180201040501.8004-11-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.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).