summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-02-27 09:10:41 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-03-01 01:44:34 +0100
commitb5f37094a13ed518adc74d2ddbc71e7a5d054eb0 (patch)
tree6148fd0ac5187c30767c1ed4a7b9e78874d4097b
parentc06be8fd568acef58888e6f702c648316ef0ef64 (diff)
rumpdisk: Override machdev_server with multithread port management
This makes rumpdisk multithreaded as much as the root filesystem pager will request. Message-Id: <20220227091013.33112-4-damien@zamaudio.com>
-rw-r--r--rumpdisk/main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/rumpdisk/main.c b/rumpdisk/main.c
index 8dbe505a..9a353541 100644
--- a/rumpdisk/main.c
+++ b/rumpdisk/main.c
@@ -93,6 +93,21 @@ static struct argp_child empty_argp_children[] = {{0}};
static struct argp rumpdisk_argp = {options, parse_opt, 0, 0, empty_argp_children};
static const struct argp *rumpdisk_argp_bootup = &rumpdisk_argp;
+static void *
+rumpdisk_multithread_server(void *arg)
+{
+ do
+ {
+ ports_manage_port_operations_multithread (machdev_device_bucket,
+ machdev_demuxer,
+ 1000 * 60 * 2, /* 2 minute thread */
+ 1000 * 60 * 10, /* 10 minute server */
+ 0);
+ } while (1);
+
+ return NULL;
+}
+
int
main (int argc, char **argv)
{
@@ -122,7 +137,7 @@ main (int argc, char **argv)
error (1, errno, "cannot lock all memory");
machdev_device_init ();
- err = pthread_create (&t, NULL, machdev_server, NULL);
+ err = pthread_create (&t, NULL, rumpdisk_multithread_server, NULL);
if (err)
return err;
pthread_detach (t);