From nobody Wed May 14 15:15:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152035914660746.84764466986826; Tue, 6 Mar 2018 09:59:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5AC7C81DEC; Tue, 6 Mar 2018 17:59:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FFC660C7B; Tue, 6 Mar 2018 17:59:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D9E9B18033F4; Tue, 6 Mar 2018 17:59:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w26Hx1d4002091 for ; Tue, 6 Mar 2018 12:59:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 05AC11C71B; Tue, 6 Mar 2018 17:59:01 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70C1D1C71E; Tue, 6 Mar 2018 17:59:00 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 6 Mar 2018 17:58:52 +0000 Message-Id: <20180306175852.18773-6-berrange@redhat.com> In-Reply-To: <20180306175852.18773-1-berrange@redhat.com> References: <20180306175852.18773-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] rpc: switch virtlockd and virtlogd to use single-threaded dispatch X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 06 Mar 2018 17:59:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Currently both virtlogd and virtlockd use a single worker thread for dispatching RPC messages. Even this is overkill and their RPC message handling callbacks all run in short, finite time and so blocking the main loop is not an issue like you'd see in libvirtd with long running QEMU commands. By setting max_workers=3D=3D0, we can turn off the worker thread and run these daemons single threaded. This in turn fixes a serious problem in the virtlockd daemon whereby it looses all fcntl() locks at re-exec due to multiple threads existing. fcntl() locks only get preserved if the process is single threaded at time of exec(). Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jim Fehlig Reviewed-by: John Ferlan --- src/locking/lock_daemon.c | 4 ++-- src/logging/log_daemon.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 79ab90fc91..7afff42246 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -165,7 +165,7 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool pr= ivileged) goto error; =20 if (!(srv =3D virNetServerNew("virtlockd", 1, - 1, 1, 0, config->max_clients, + 0, 0, 0, config->max_clients, config->max_clients, -1, 0, NULL, virLockDaemonClientNew, @@ -180,7 +180,7 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool pr= ivileged) srv =3D NULL; =20 if (!(srv =3D virNetServerNew("admin", 1, - 1, 1, 0, config->admin_max_clients, + 0, 0, 0, config->admin_max_clients, config->admin_max_clients, -1, 0, NULL, remoteAdmClientNew, diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index d54d26ab9d..35d7ebb6d2 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -154,7 +154,7 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool priv= ileged) goto error; =20 if (!(srv =3D virNetServerNew("virtlogd", 1, - 1, 1, 0, config->max_clients, + 0, 0, 0, config->max_clients, config->max_clients, -1, 0, NULL, virLogDaemonClientNew, @@ -169,7 +169,7 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool priv= ileged) srv =3D NULL; =20 if (!(srv =3D virNetServerNew("admin", 1, - 1, 1, 0, config->admin_max_clients, + 0, 0, 0, config->admin_max_clients, config->admin_max_clients, -1, 0, NULL, remoteAdmClientNew, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list