From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YToSc-0006FM-6h for qemu-devel@nongnu.org; Fri, 06 Mar 2015 04:22:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YToSY-0002Xz-WA for qemu-devel@nongnu.org; Fri, 06 Mar 2015 04:22:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YToSY-0002Xu-Ob for qemu-devel@nongnu.org; Fri, 06 Mar 2015 04:22:18 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t269MHPl016871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 6 Mar 2015 04:22:17 -0500 From: Paolo Bonzini Date: Fri, 6 Mar 2015 10:22:13 +0100 Message-Id: <1425633735-26796-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] rcu: support fork List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Supporting fork in multithreaded programs is somewhat complicated, however in QEMU we fork in two places (daemonize and smbd) and none of them are complicated: - daemonize happens before threads and mutexes proliferate unpredictably; only the RCU state has to be reset and the call_rcu thread recreated - smbd mostly does an exec in the child. Unfortunately, glibc also makes forking terminally incompatible with PTHREAD_MUTEX_ERRORCHECK, so you also need to disable that. Paolo Paolo Bonzini (2): qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK rcu: handle forks safely util/qemu-thread-posix.c | 6 +----- util/rcu.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 6 deletions(-) -- 2.3.0