No description
Find a file
Jakub Kicinski 02a97e02c6 mlx5-updates-2022-10-24
SW steering updates from Yevgeny Kliteynik:
 
 1) 1st Four patches: small fixes / optimizations for SW steering:
 
  - Patch 1: Don't abort destroy flow if failed to destroy table - continue
    and free everything else.
  - Patches 2 and 3 deal with fast teardown:
     + Skip sync during fast teardown, as PCI device is not there any more.
     + Check device state when polling CQ - otherwise SW steering keeps polling
       the CQ forever, because nobody is there to flush it.
  - Patch 4: Removing unneeded function argument.
 
 2) Deal with the hiccups that we get during rules insertion/deletion,
 which sometimes reach 1/4 of a second. While insertion/deletion rate
 improvement was not the focus here, it still is a by-product of removing these
 hiccups.
 
 Another by-product is the reduced standard deviation in measuring the duration
 of rules insertion/deletion bursts.
 
 In the testing we add K rules (warm-up phase), and then continuously do
 insertion/deletion bursts of N rules.
 During the test execution, the driver measures hiccups (amount and duration)
 and total time for insertion/deletion of a batch of rules.
 
 Here are some numbers, before and after these patches:
 
 +--------------------------------------------+-----------------+----------------+
 |                                            |   Create rules  |  Delete rules  |
 |                                            +--------+--------+--------+-------+
 |                                            | Before |  After | Before | After |
 +--------------------------------------------+--------+--------+--------+-------+
 | Max hiccup [msec]                          |    253 |     42 |    254 |    68 |
 +--------------------------------------------+--------+--------+--------+-------+
 | Avg duration of 10K rules add/remove [msec]| 140.07 | 124.32 | 106.99 | 99.51 |
 +--------------------------------------------+--------+--------+--------+-------+
 | Num of hiccups per 100K rules add/remove   |   7.77 |   7.97 |  12.60 | 11.57 |
 +--------------------------------------------+--------+--------+--------+-------+
 | Avg hiccup duration [msec]                 |  36.92 |  33.25 |  36.15 | 33.74 |
 +--------------------------------------------+--------+--------+--------+-------+
 
  - Patch 5: Allocate a short array on stack instead of dynamically- it is
    destroyed at the end of the function.
  - Patch 6: Rather than cleaning the corresponding chunk's section of
    ste_arrays on chunk deletion, initialize these areas upon chunk creation.
    Chunk destruction tend to come in large batches (during pool syncing),
    so instead of doing huge memory initialization during pool sync,
    we amortize this by doing small initsializations on chunk creation.
  - Patch 7: In order to simplifies error flow and allows cleaner addition
    of new pools, handle creation/destruction of all the domain's memory pools
    and other memory-related fields in a separate init/uninit functions.
  - Patch 8: During rehash, write each table row immediately instead of waiting
    for the whole table to be ready and writing it all - saves allocations
    of ste_send_info structures and improves performance.
  - Patch 9: Instead of allocating/freeing send info objects dynamically,
    manage them in pool. The number of send info objects doesn't depend on
    number of rules, so after pre-populating the pool with an initial batch of
    send info objects, the pool is not expected to grow.
    This way we save alloc/free during writing STEs to ICM, which by itself can
    sometimes take up to 40msec.
  - Patch 10: Allocate icm_chunks from their own slab allocator, which lowered
    the alloc/free "hiccups" frequency.
  - Patch 11: Similar to patch 9, allocate htbl from its own slab allocator.
  - Patch 12: Lower sync threshold for ICM hot memory - set the threshold for
    sync to 1/4 of the pool instead of 1/2 of the pool. Although we will have
    more syncs, each     sync will be shorter and will help with insertion rate
    stability. Also, notice that the overall number of hiccups wasn't increased
    due to all the other patches.
  - Patch 13: Keep track of hot ICM chunks in an array instead of list.
    After steering sync, we traverse the hot list and finally free all the
    chunks. It appears that traversing a long list takes unusually long time
    due to cache misses on many entries, which causes a big "hiccup" during
    rule insertion. This patch replaces the list with pre-allocated array that
    stores only the bookkeeping information that is needed to later free the
    chunks in its buddy allocator.
  - Patch 14: Remove the unneeded buddy used_list - we don't need to have the
    list of used chunks, we only need the total amount of used memory.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGhZs6bAKwk/OTgTpSD+KveBX+j4FAmNamsEACgkQSD+KveBX
 +j6hWgf/ec6O0Ige4Az9quVtN1YiLRpcA4RJs5prV/2qyqcjzpkumTLpWgFzD6SM
 T7uz/lQY4/JTLAkFNQBE6aynjtFfUP7bJ2LulqE+8QXBmHoHndHA+S3ZBGAmjLgK
 9tY73Bb5qxsHCzEvaab+UxEIWXiBPtaNaw5mkzKKO5ULCplVl1loKxVEmLO1ri7j
 fa7G7I1VHgSg6/7GWPzMN9tsR8b927H9gdRw3atTC91T8jgwf+9YYXmhd4Bj2Dk0
 uB1n4AyVCcLxGZiFtNHUSyBNIvFwaO87DzBDDftIJPSMcJvRJxeBx0692Z7sZdE0
 cfta+4bPDpjHVNN2slcYgzJu/jDh8w==
 =5XcL
 -----END PGP SIGNATURE-----

Merge tag 'mlx5-updates-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2022-10-24

SW steering updates from Yevgeny Kliteynik:

1) 1st Four patches: small fixes / optimizations for SW steering:

 - Patch 1: Don't abort destroy flow if failed to destroy table - continue
   and free everything else.
 - Patches 2 and 3 deal with fast teardown:
    + Skip sync during fast teardown, as PCI device is not there any more.
    + Check device state when polling CQ - otherwise SW steering keeps polling
      the CQ forever, because nobody is there to flush it.
 - Patch 4: Removing unneeded function argument.

2) Deal with the hiccups that we get during rules insertion/deletion,
which sometimes reach 1/4 of a second. While insertion/deletion rate
improvement was not the focus here, it still is a by-product of removing these
hiccups.

Another by-product is the reduced standard deviation in measuring the duration
of rules insertion/deletion bursts.

In the testing we add K rules (warm-up phase), and then continuously do
insertion/deletion bursts of N rules.
During the test execution, the driver measures hiccups (amount and duration)
and total time for insertion/deletion of a batch of rules.

Here are some numbers, before and after these patches:

+--------------------------------------------+-----------------+----------------+
|                                            |   Create rules  |  Delete rules  |
|                                            +--------+--------+--------+-------+
|                                            | Before |  After | Before | After |
+--------------------------------------------+--------+--------+--------+-------+
| Max hiccup [msec]                          |    253 |     42 |    254 |    68 |
+--------------------------------------------+--------+--------+--------+-------+
| Avg duration of 10K rules add/remove [msec]| 140.07 | 124.32 | 106.99 | 99.51 |
+--------------------------------------------+--------+--------+--------+-------+
| Num of hiccups per 100K rules add/remove   |   7.77 |   7.97 |  12.60 | 11.57 |
+--------------------------------------------+--------+--------+--------+-------+
| Avg hiccup duration [msec]                 |  36.92 |  33.25 |  36.15 | 33.74 |
+--------------------------------------------+--------+--------+--------+-------+

 - Patch 5: Allocate a short array on stack instead of dynamically- it is
   destroyed at the end of the function.
 - Patch 6: Rather than cleaning the corresponding chunk's section of
   ste_arrays on chunk deletion, initialize these areas upon chunk creation.
   Chunk destruction tend to come in large batches (during pool syncing),
   so instead of doing huge memory initialization during pool sync,
   we amortize this by doing small initsializations on chunk creation.
 - Patch 7: In order to simplifies error flow and allows cleaner addition
   of new pools, handle creation/destruction of all the domain's memory pools
   and other memory-related fields in a separate init/uninit functions.
 - Patch 8: During rehash, write each table row immediately instead of waiting
   for the whole table to be ready and writing it all - saves allocations
   of ste_send_info structures and improves performance.
 - Patch 9: Instead of allocating/freeing send info objects dynamically,
   manage them in pool. The number of send info objects doesn't depend on
   number of rules, so after pre-populating the pool with an initial batch of
   send info objects, the pool is not expected to grow.
   This way we save alloc/free during writing STEs to ICM, which by itself can
   sometimes take up to 40msec.
 - Patch 10: Allocate icm_chunks from their own slab allocator, which lowered
   the alloc/free "hiccups" frequency.
 - Patch 11: Similar to patch 9, allocate htbl from its own slab allocator.
 - Patch 12: Lower sync threshold for ICM hot memory - set the threshold for
   sync to 1/4 of the pool instead of 1/2 of the pool. Although we will have
   more syncs, each     sync will be shorter and will help with insertion rate
   stability. Also, notice that the overall number of hiccups wasn't increased
   due to all the other patches.
 - Patch 13: Keep track of hot ICM chunks in an array instead of list.
   After steering sync, we traverse the hot list and finally free all the
   chunks. It appears that traversing a long list takes unusually long time
   due to cache misses on many entries, which causes a big "hiccup" during
   rule insertion. This patch replaces the list with pre-allocated array that
   stores only the bookkeeping information that is needed to later free the
   chunks in its buddy allocator.
 - Patch 14: Remove the unneeded buddy used_list - we don't need to have the
   list of used chunks, we only need the total amount of used memory.

* tag 'mlx5-updates-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
  net/mlx5: DR, Remove the buddy used_list
  net/mlx5: DR, Keep track of hot ICM chunks in an array instead of list
  net/mlx5: DR, Lower sync threshold for ICM hot memory
  net/mlx5: DR, Allocate htbl from its own slab allocator
  net/mlx5: DR, Allocate icm_chunks from their own slab allocator
  net/mlx5: DR, Manage STE send info objects in pool
  net/mlx5: DR, In rehash write the line in the entry immediately
  net/mlx5: DR, Handle domain memory resources init/uninit separately
  net/mlx5: DR, Initialize chunk's ste_arrays at chunk creation
  net/mlx5: DR, For short chains of STEs, avoid allocating ste_arr dynamically
  net/mlx5: DR, Remove unneeded argument from dr_icm_chunk_destroy
  net/mlx5: DR, Check device state when polling CQ
  net/mlx5: DR, Fix the SMFS sync_steering for fast teardown
  net/mlx5: DR, In destroy flow, free resources even if FW command failed
====================

Link: https://lore.kernel.org/r/20221027145643.6618-1-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-10-28 22:07:48 -07:00
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-27 16:56:36 -07:00
block
certs
crypto
Documentation tcp: add sysctls for TCP PLB parameters 2022-10-28 10:47:42 +01:00
drivers mlx5-updates-2022-10-24 2022-10-28 22:07:48 -07:00
fs execve fixes for v6.1-rc3 2022-10-27 13:16:36 -07:00
include net/packet: add PACKET_FANOUT_FLAG_IGNORE_OUTGOING 2022-10-28 22:00:49 -07:00
init
io_uring
ipc
kernel
lib Including fixes from 802.15.4 (Zigbee et al.). 2022-10-27 13:36:59 -07:00
LICENSES
mm
net net/packet: add PACKET_FANOUT_FLAG_IGNORE_OUTGOING 2022-10-28 22:00:49 -07:00
rust
samples
scripts
security
sound
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-27 16:56:36 -07:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-27 16:56:36 -07:00
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.