All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] tools/ocaml/xenstored: simplify code
@ 2020-08-17 18:39 Edwin Török
  2020-08-17 18:39 ` [PATCH v2 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment Edwin Török
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Edwin Török @ 2020-08-17 18:39 UTC (permalink / raw)
  To: xen-devel
  Cc: Edwin Török, Christian Lindig, David Scott,
	Ian Jackson, Wei Liu

Fix warnings, and delete some obsolete code.
oxenstored contained a hand-rolled GC to perform hash-consing:
this can be done with a lot fewer lines of code by using the built-in Weak module.

The choice of data structures for trees/tries is not very efficient: they are just
lists. Using a map improves lookup and deletion complexity, and replaces hand-rolled
recursion with higher-level library calls.

There is a lot more that could be done to optimize socket polling:
an epoll backend with a poll fallback,but API structured around event-based polling
would be better. But first lets drop the legacy select based code: I think every
modern *nix should have a working poll(3) by now.

Changes since v1:
  * passed some testing
  * fix commit title on 'drop select based'
  * fix missing 'set_node' in 'set' that got lost in conversion to map
  * simplify 'compare' function

Edwin Török (6):
  tools/ocaml/libs/xc: Fix ambiguous documentation comment
  tools/ocaml/xenstored: fix deprecation warning
  tools/ocaml/xenstored: replace hand rolled GC with weak GC references
  tools/ocaml/xenstored: drop select based socket watching
  tools/ocaml/xenstored: use more efficient node trees
  tools/ocaml/xenstored: use more efficient tries

 tools/ocaml/libs/xc/xenctrl.mli               |  2 +
 tools/ocaml/xenstored/Makefile                | 12 ++--
 tools/ocaml/xenstored/connection.ml           |  3 -
 tools/ocaml/xenstored/connections.ml          |  2 +-
 tools/ocaml/xenstored/disk.ml                 |  2 +-
 tools/ocaml/xenstored/history.ml              | 14 ----
 tools/ocaml/xenstored/parse_arg.ml            |  7 +-
 tools/ocaml/xenstored/{select.ml => poll.ml}  | 14 +---
 .../ocaml/xenstored/{select.mli => poll.mli}  | 12 +---
 tools/ocaml/xenstored/store.ml                | 49 ++++++-------
 tools/ocaml/xenstored/symbol.ml               | 70 +++++--------------
 tools/ocaml/xenstored/symbol.mli              | 22 ++----
 tools/ocaml/xenstored/trie.ml                 | 59 +++++++---------
 tools/ocaml/xenstored/trie.mli                | 26 +++----
 tools/ocaml/xenstored/xenstored.ml            | 20 +-----
 15 files changed, 103 insertions(+), 211 deletions(-)
 rename tools/ocaml/xenstored/{select.ml => poll.ml} (85%)
 rename tools/ocaml/xenstored/{select.mli => poll.mli} (58%)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-17 18:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 18:39 [PATCH v2 0/6] tools/ocaml/xenstored: simplify code Edwin Török
2020-08-17 18:39 ` [PATCH v2 1/6] tools/ocaml/libs/xc: Fix ambiguous documentation comment Edwin Török
2020-08-17 18:39 ` [PATCH v2 2/6] tools/ocaml/xenstored: fix deprecation warning Edwin Török
2020-08-17 18:39 ` [PATCH v2 3/6] tools/ocaml/xenstored: replace hand rolled GC with weak GC references Edwin Török
2020-08-17 18:39 ` [PATCH v2 4/6] tools/ocaml/xenstored: drop select based socket watching Edwin Török
2020-08-17 18:39 ` [PATCH v2 5/6] tools/ocaml/xenstored: use more efficient node trees Edwin Török
2020-08-17 18:39 ` [PATCH v2 6/6] tools/ocaml/xenstored: use more efficient tries Edwin Török

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.