Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
xen.28171
xsa419-02.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa419-02.patch of Package xen.28171
From 46ae93fdfdac7dc088a5f7b11b7cb25c48717727 Mon Sep 17 00:00:00 2001 From: Juergen Gross <jgross@suse.com> Date: Tue, 13 Sep 2022 07:35:13 +0200 Subject: tools/xenstore: make the internal memory data base the default Having a file backed data base has the only advantage of being capable to dump the contents of it while Xenstore is running, and potentially using less swap space in case the data base can't be kept in memory. It has the major disadvantage of a huge performance overhead: switching to keep the data base in memory only speeds up live update of xenstored with 120000 nodes from 20 minutes to 11 seconds. A complete tree walk of this configuration will be reduced from 7 seconds to 280 msecs (measured by "xenstore-control check"). So make the internal memory data base the default and enhance the "--internal-db" command line parameter to take an optional parameter allowing to switch the internal data base back to the file based one. This is part of XSA-419. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Julien Grall <jgrall@amazon.com> diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c index 4ce8299c3c36..2dfc78d4de56 100644 --- a/tools/helpers/init-xenstore-domain.c +++ b/tools/helpers/init-xenstore-domain.c @@ -137,9 +137,9 @@ static int build(xc_interface *xch) } if ( param ) - snprintf(cmdline, 512, "--event %d --internal-db %s", rv, param); + snprintf(cmdline, 512, "--event %d %s", rv, param); else - snprintf(cmdline, 512, "--event %d --internal-db", rv); + snprintf(cmdline, 512, "--event %d", rv); dom = xc_dom_allocate(xch, cmdline, NULL); if ( !dom ) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index eb1d7c2b3b9b..7ed852fd7958 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -2134,7 +2134,7 @@ static void accept_connection(int sock, bool canwrite) } #endif -static int tdb_flags; +static int tdb_flags = TDB_INTERNAL | TDB_NOLOCK; /* We create initial nodes manually. */ static void manual_node(const char *name, const char *child) @@ -2446,7 +2446,8 @@ static void usage(void) " watch-event: time a watch-event is kept pending\n" " -R, --no-recovery to request that no recovery should be attempted when\n" " the store is corrupted (debug only),\n" -" -I, --internal-db store database in memory, not on disk\n" +" -I, --internal-db [on|off] store database in memory, not on disk, default is\n" +" memory, with \"--internal-db off\" it is on disk\n" " -K, --keep-orphans don't delete nodes owned by a domain when the\n" " domain is deleted (this is a security risk!)\n" " -V, --verbose to request verbose execution.\n"); @@ -2471,7 +2472,7 @@ static struct option options[] = { { "quota-soft", 1, NULL, 'q' }, { "timeout", 1, NULL, 'w' }, { "no-recovery", 0, NULL, 'R' }, - { "internal-db", 0, NULL, 'I' }, + { "internal-db", 2, NULL, 'I' }, { "keep-orphans", 0, NULL, 'K' }, { "verbose", 0, NULL, 'V' }, { "watch-nb", 1, NULL, 'W' }, @@ -2547,7 +2548,8 @@ int main(int argc, char *argv[]) int timeout; - while ((opt = getopt_long(argc, argv, "DE:F:HKNPS:t:A:Q:q:T:RVW:w:", options, + while ((opt = getopt_long(argc, argv, + "DE:F:HI::KNPS:t:A:Q:q:T:RVW:w:", options, NULL)) != -1) { switch (opt) { case 'D': @@ -2581,7 +2583,8 @@ int main(int argc, char *argv[]) tracefile = optarg; break; case 'I': - tdb_flags = TDB_INTERNAL|TDB_NOLOCK; + if (optarg && !strcmp(optarg, "off")) + tdb_flags = 0; break; case 'K': keep_orphans = true;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor