[PATCH v4 00/19] tools/xenstore: drop TDB

Juergen Gross posted 19 patches 8 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230814074707.27696-1-jgross@suse.com
.gitignore                                    |    2 +-
MAINTAINERS                                   |    1 +
configure                                     |    5 +
m4/paths.m4                                   |    1 +
stubdom/Makefile                              |    4 +-
tools/Makefile                                |    1 +
tools/config.h.in                             |    3 +
tools/configure                               |    5 +
tools/libs/store/Makefile                     |    1 -
tools/xenstore/Makefile                       |   30 +-
tools/xenstore/Makefile.common                |   31 -
tools/xenstore/tdb.c                          | 1748 -----------------
tools/xenstore/tdb.h                          |  132 --
tools/xenstored/Makefile                      |   48 +
tools/xenstored/Makefile.common               |   29 +
tools/{xenstore => xenstored}/README          |    0
.../control.c}                                |    8 +-
.../control.h}                                |    0
.../xenstored_core.c => xenstored/core.c}     |  643 +++---
.../xenstored_core.h => xenstored/core.h}     |   77 +-
.../xenstored_domain.c => xenstored/domain.c} |   44 +-
.../xenstored_domain.h => xenstored/domain.h} |    8 +-
tools/{xenstore => xenstored}/hashtable.c     |   60 +-
tools/{xenstore => xenstored}/hashtable.h     |   24 +-
tools/{xenstore => xenstored}/list.h          |    0
.../xenstored_lu.c => xenstored/lu.c}         |    8 +-
.../xenstored_lu.h => xenstored/lu.h}         |    0
.../lu_daemon.c}                              |    4 +-
.../lu_minios.c}                              |    2 +-
.../xenstored_minios.c => xenstored/minios.c} |    2 +-
.../xenstored_osdep.h => xenstored/osdep.h}   |    0
.../xenstored_posix.c => xenstored/posix.c}   |    4 +-
tools/{xenstore => xenstored}/talloc.c        |   10 +-
tools/{xenstore => xenstored}/talloc.h        |    4 +-
.../{xenstore => xenstored}/talloc_guide.txt  |    0
.../transaction.c}                            |   57 +-
.../transaction.h}                            |    2 +-
tools/{xenstore => xenstored}/utils.c         |    0
tools/{xenstore => xenstored}/utils.h         |    9 -
.../xenstored_watch.c => xenstored/watch.c}   |   45 +-
.../xenstored_watch.h => xenstored/watch.h}   |    5 +-
.../include => xenstored}/xenstore_state.h    |    0
42 files changed, 666 insertions(+), 2391 deletions(-)
delete mode 100644 tools/xenstore/Makefile.common
delete mode 100644 tools/xenstore/tdb.c
delete mode 100644 tools/xenstore/tdb.h
create mode 100644 tools/xenstored/Makefile
create mode 100644 tools/xenstored/Makefile.common
rename tools/{xenstore => xenstored}/README (100%)
rename tools/{xenstore/xenstored_control.c => xenstored/control.c} (98%)
rename tools/{xenstore/xenstored_control.h => xenstored/control.h} (100%)
rename tools/{xenstore/xenstored_core.c => xenstored/core.c} (88%)
rename tools/{xenstore/xenstored_core.h => xenstored/core.h} (88%)
rename tools/{xenstore/xenstored_domain.c => xenstored/domain.c} (98%)
rename tools/{xenstore/xenstored_domain.h => xenstored/domain.h} (95%)
rename tools/{xenstore => xenstored}/hashtable.c (89%)
rename tools/{xenstore => xenstored}/hashtable.h (89%)
rename tools/{xenstore => xenstored}/list.h (100%)
rename tools/{xenstore/xenstored_lu.c => xenstored/lu.c} (98%)
rename tools/{xenstore/xenstored_lu.h => xenstored/lu.h} (100%)
rename tools/{xenstore/xenstored_lu_daemon.c => xenstored/lu_daemon.c} (97%)
rename tools/{xenstore/xenstored_lu_minios.c => xenstored/lu_minios.c} (98%)
rename tools/{xenstore/xenstored_minios.c => xenstored/minios.c} (97%)
rename tools/{xenstore/xenstored_osdep.h => xenstored/osdep.h} (100%)
rename tools/{xenstore/xenstored_posix.c => xenstored/posix.c} (98%)
rename tools/{xenstore => xenstored}/talloc.c (99%)
rename tools/{xenstore => xenstored}/talloc.h (98%)
rename tools/{xenstore => xenstored}/talloc_guide.txt (100%)
rename tools/{xenstore/xenstored_transaction.c => xenstored/transaction.c} (93%)
rename tools/{xenstore/xenstored_transaction.h => xenstored/transaction.h} (98%)
rename tools/{xenstore => xenstored}/utils.c (100%)
rename tools/{xenstore => xenstored}/utils.h (89%)
rename tools/{xenstore/xenstored_watch.c => xenstored/watch.c} (90%)
rename tools/{xenstore/xenstored_watch.h => xenstored/watch.h} (93%)
rename tools/{xenstore/include => xenstored}/xenstore_state.h (100%)
[PATCH v4 00/19] tools/xenstore: drop TDB
Posted by Juergen Gross 8 months, 2 weeks ago
Using TDB for storing the Xenstore nodes is adding more complexity
instead of removing it. With keeping the data in memory only, the main
reason for using TDB has disappeared.

This series is replacing TDB with a hashlist referencing directly
individually allocated Xenstore nodes.

This in turn allows to use references of the stored nodes instead of
copying them in case only read access is needed. Some simple tests
using the test-xenstore utility have shown no single test being slower
with this series applied, but some tests experienced up to 10% better
performance.

Changes in V4:
- addressed comments
- patches 1-7 already applied
- dropped patch 15 of v3
- add patches 18+19

Changes in V3:
- addressed comments
- add patches 14+15
- replace patch 18 of v2 with patches 20-25

Changes in V2:
- addressed comments
- split former patch 9 into 2 patches
- added patches 13-18

Juergen Gross (19):
  tools/xenstore: make hashtable key parameter const
  tools/xenstore: let hashtable_add() fail in case of existing entry
  tools/xenstore: add hashtable_replace() function
  tools/xenstore: drop use of tdb
  tools/xenstore: remove tdb code
  tools/xenstore: let db_delete() return void
  tools/xenstore: change talloc_free() to take a const pointer
  tools/xenstore: move copying of node data out of db_fetch()
  tools/xenstore: rework struct xs_tdb_record_hdr
  tools/xenstore: don't use struct node_perms in struct node
  tools/xenstore: use struct node_hdr in struct node
  tools/xenstore: alloc new memory in domain_adjust_node_perms()
  tools/xenstore: introduce read_node_const()
  tools/xenstore: merge get_spec_node() into get_node_canonicalized()
  tools/xenstore: merge is_valid_nodename() into canonicalize()
  tools/xenstore: rework get_node()
  tools/xenstore: introduce get_node_const()
  tools/config: add XEN_RUN_STORED to config.h
  tools/xenstore: move xenstored sources into dedicated directory

 .gitignore                                    |    2 +-
 MAINTAINERS                                   |    1 +
 configure                                     |    5 +
 m4/paths.m4                                   |    1 +
 stubdom/Makefile                              |    4 +-
 tools/Makefile                                |    1 +
 tools/config.h.in                             |    3 +
 tools/configure                               |    5 +
 tools/libs/store/Makefile                     |    1 -
 tools/xenstore/Makefile                       |   30 +-
 tools/xenstore/Makefile.common                |   31 -
 tools/xenstore/tdb.c                          | 1748 -----------------
 tools/xenstore/tdb.h                          |  132 --
 tools/xenstored/Makefile                      |   48 +
 tools/xenstored/Makefile.common               |   29 +
 tools/{xenstore => xenstored}/README          |    0
 .../control.c}                                |    8 +-
 .../control.h}                                |    0
 .../xenstored_core.c => xenstored/core.c}     |  643 +++---
 .../xenstored_core.h => xenstored/core.h}     |   77 +-
 .../xenstored_domain.c => xenstored/domain.c} |   44 +-
 .../xenstored_domain.h => xenstored/domain.h} |    8 +-
 tools/{xenstore => xenstored}/hashtable.c     |   60 +-
 tools/{xenstore => xenstored}/hashtable.h     |   24 +-
 tools/{xenstore => xenstored}/list.h          |    0
 .../xenstored_lu.c => xenstored/lu.c}         |    8 +-
 .../xenstored_lu.h => xenstored/lu.h}         |    0
 .../lu_daemon.c}                              |    4 +-
 .../lu_minios.c}                              |    2 +-
 .../xenstored_minios.c => xenstored/minios.c} |    2 +-
 .../xenstored_osdep.h => xenstored/osdep.h}   |    0
 .../xenstored_posix.c => xenstored/posix.c}   |    4 +-
 tools/{xenstore => xenstored}/talloc.c        |   10 +-
 tools/{xenstore => xenstored}/talloc.h        |    4 +-
 .../{xenstore => xenstored}/talloc_guide.txt  |    0
 .../transaction.c}                            |   57 +-
 .../transaction.h}                            |    2 +-
 tools/{xenstore => xenstored}/utils.c         |    0
 tools/{xenstore => xenstored}/utils.h         |    9 -
 .../xenstored_watch.c => xenstored/watch.c}   |   45 +-
 .../xenstored_watch.h => xenstored/watch.h}   |    5 +-
 .../include => xenstored}/xenstore_state.h    |    0
 42 files changed, 666 insertions(+), 2391 deletions(-)
 delete mode 100644 tools/xenstore/Makefile.common
 delete mode 100644 tools/xenstore/tdb.c
 delete mode 100644 tools/xenstore/tdb.h
 create mode 100644 tools/xenstored/Makefile
 create mode 100644 tools/xenstored/Makefile.common
 rename tools/{xenstore => xenstored}/README (100%)
 rename tools/{xenstore/xenstored_control.c => xenstored/control.c} (98%)
 rename tools/{xenstore/xenstored_control.h => xenstored/control.h} (100%)
 rename tools/{xenstore/xenstored_core.c => xenstored/core.c} (88%)
 rename tools/{xenstore/xenstored_core.h => xenstored/core.h} (88%)
 rename tools/{xenstore/xenstored_domain.c => xenstored/domain.c} (98%)
 rename tools/{xenstore/xenstored_domain.h => xenstored/domain.h} (95%)
 rename tools/{xenstore => xenstored}/hashtable.c (89%)
 rename tools/{xenstore => xenstored}/hashtable.h (89%)
 rename tools/{xenstore => xenstored}/list.h (100%)
 rename tools/{xenstore/xenstored_lu.c => xenstored/lu.c} (98%)
 rename tools/{xenstore/xenstored_lu.h => xenstored/lu.h} (100%)
 rename tools/{xenstore/xenstored_lu_daemon.c => xenstored/lu_daemon.c} (97%)
 rename tools/{xenstore/xenstored_lu_minios.c => xenstored/lu_minios.c} (98%)
 rename tools/{xenstore/xenstored_minios.c => xenstored/minios.c} (97%)
 rename tools/{xenstore/xenstored_osdep.h => xenstored/osdep.h} (100%)
 rename tools/{xenstore/xenstored_posix.c => xenstored/posix.c} (98%)
 rename tools/{xenstore => xenstored}/talloc.c (99%)
 rename tools/{xenstore => xenstored}/talloc.h (98%)
 rename tools/{xenstore => xenstored}/talloc_guide.txt (100%)
 rename tools/{xenstore/xenstored_transaction.c => xenstored/transaction.c} (93%)
 rename tools/{xenstore/xenstored_transaction.h => xenstored/transaction.h} (98%)
 rename tools/{xenstore => xenstored}/utils.c (100%)
 rename tools/{xenstore => xenstored}/utils.h (89%)
 rename tools/{xenstore/xenstored_watch.c => xenstored/watch.c} (90%)
 rename tools/{xenstore/xenstored_watch.h => xenstored/watch.h} (93%)
 rename tools/{xenstore/include => xenstored}/xenstore_state.h (100%)

-- 
2.35.3
Re: [PATCH v4 00/19] tools/xenstore: drop TDB
Posted by Julien Grall 8 months, 1 week ago
Hi Juergen,

On 14/08/2023 08:46, Juergen Gross wrote:
> Juergen Gross (19):
>    tools/xenstore: make hashtable key parameter const
>    tools/xenstore: let hashtable_add() fail in case of existing entry
>    tools/xenstore: add hashtable_replace() function
>    tools/xenstore: drop use of tdb
>    tools/xenstore: remove tdb code
>    tools/xenstore: let db_delete() return void
>    tools/xenstore: change talloc_free() to take a const pointer
>    tools/xenstore: move copying of node data out of db_fetch()
>    tools/xenstore: rework struct xs_tdb_record_hdr
>    tools/xenstore: don't use struct node_perms in struct node
>    tools/xenstore: use struct node_hdr in struct node
>    tools/xenstore: alloc new memory in domain_adjust_node_perms()
>    tools/xenstore: introduce read_node_const()
>    tools/xenstore: merge get_spec_node() into get_node_canonicalized()
>    tools/xenstore: merge is_valid_nodename() into canonicalize()
>    tools/xenstore: rework get_node()
>    tools/xenstore: introduce get_node_const()
>    tools/config: add XEN_RUN_STORED to config.h

I have committed up to this patch.

Cheers,


-- 
Julien Grall