Scale tests have identified the lflow cache to be one of the main memory consumers in ovn-controller. This series refactors the lflow cache code and adds configuration knobs to limit the size (in lines and/or memory) of the cache.
Patches 1 and 6 fix issues with the already existing lflow cache code. Even though patch 6 is a bug fix, it's easier to add it later in the series because it uses the new lflow cache statistics (from patch 4) to add a unit test that exercises the buggy scenario. Changes in v3: - Addressed Mark and Numan's comments (individual changes listed in each patch). - Added acks where applicable. Changes in v2: - Added two bug fixes for already existing problems (patches 1 and 6). - Added unit tests as requested by Mark. - Added support for evicting "less important" entries when the cache limit is reached. - Improved cache entries memory accounting. Dumitru Ceara (10): lflow: Fix cache update when I-P engine aborts. lflow: Refactor convert_match_to_expr() to explicitly consume prereqs. lflow-cache: Move the lflow cache to its own module. lflow-cache: Add lflow-cache/show-stats command. lflow-cache: Add unit tests. lflow: Do not cache non-conjunctive flows that use address sets/portgroups. lflow-cache: Add coverage counters. lflow-cache: Reclaim heap memory after cache flush. lflow-cache: Make maximum number of cache entries configurable. lflow-cache: Make max cache memory usage configurable. NEWS | 5 configure.ac | 1 controller/automake.mk | 2 controller/chassis.c | 44 ++++ controller/lflow-cache.c | 371 ++++++++++++++++++++++++++++++++++++ controller/lflow-cache.h | 81 ++++++++ controller/lflow.c | 378 +++++++++++++----------------------- controller/lflow.h | 10 - controller/ovn-controller.8.xml | 34 +++ controller/ovn-controller.c | 106 +++++++--- controller/test-lflow-cache.c | 238 +++++++++++++++++++++++ controller/test-ofctrl-seqno.c | 18 -- include/ovn/expr.h | 3 lib/expr.c | 43 ++++ tests/automake.mk | 8 + tests/ovn-lflow-cache.at | 405 +++++++++++++++++++++++++++++++++++++++ tests/ovn.at | 82 ++++++++ tests/test-utils.c | 49 +++++ tests/test-utils.h | 26 +++ tests/testsuite.at | 1 20 files changed, 1597 insertions(+), 308 deletions(-) create mode 100644 controller/lflow-cache.c create mode 100644 controller/lflow-cache.h create mode 100644 controller/test-lflow-cache.c create mode 100644 tests/ovn-lflow-cache.at create mode 100644 tests/test-utils.c create mode 100644 tests/test-utils.h _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev