Posting this as RFC as I'm not fully content with my test results.

With this series there are still situations where we overrun the
time threashold and subsequently get into the situation we are trying
to fix with this series.

During testing I found a destroy call [0] to take around 500ms, but
as far as I read the code that ends up being a single call to free()
so that does not quite make sense.  Working on replicating in a
different test bed and continuing to pin-point the source of the
last time threshold overruns.  Will post a follow-up soon.

0: 
https://github.com/openvswitch/ovs/blob/4102674b3ecadb0e20e512cc661cddbbc4b3d1f6/ovsdb/monitor.c#L1290

Introduce cooperative multitasking module which allow us to
interleave important processing with long running tasks while
avoiding the additional resource consumption of threads and
complexity of asynchronous state machines.

We will use this module to ensure long running processing in the
OVSDB server does not interfere with stable maintenance of the
RAFT cluster in subsequent patches.

Relevant discussion:
https://mail.openvswitch.org/pipermail/ovs-discuss/2022-December/052140.html
https://mail.openvswitch.org/pipermail/ovs-dev/2023-December/410262.html


Frode Nordahl (5):
  timeval: Make timewarp available for internal callers.
  lib: Introduce cooperative multitasking module.
  ovsdb/raft: Register for cooperative multitasking.
  json: Add yielding serialized object create function.
  ovsdb-server: Make use of cooperative multitasking.

 NEWS                                   |   8 +
 include/openvswitch/json.h             |   4 +-
 lib/automake.mk                        |   3 +
 lib/cooperative-multitasking-private.h |  30 +++
 lib/cooperative-multitasking.c         | 192 ++++++++++++++++++
 lib/cooperative-multitasking.h         |  42 ++++
 lib/json.c                             |  43 ++--
 lib/timeval.c                          |  56 ++++--
 lib/timeval.h                          |   4 +
 ovsdb/file.c                           |   2 +
 ovsdb/jsonrpc-server.c                 |   3 +
 ovsdb/monitor.c                        |  25 ++-
 ovsdb/ovsdb-server.c                   |   5 +
 ovsdb/raft.c                           |  12 +-
 tests/automake.mk                      |   1 +
 tests/library.at                       |  10 +
 tests/ovsdb-server.at                  |   1 +
 tests/test-cooperative-multitasking.c  | 259 +++++++++++++++++++++++++
 18 files changed, 673 insertions(+), 27 deletions(-)
 create mode 100644 lib/cooperative-multitasking-private.h
 create mode 100644 lib/cooperative-multitasking.c
 create mode 100644 lib/cooperative-multitasking.h
 create mode 100644 tests/test-cooperative-multitasking.c

-- 
2.34.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to