From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTkjS-0002bh-2c for qemu-devel@nongnu.org; Mon, 03 Dec 2018 04:41:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTkXw-0004Lz-Bn for qemu-devel@nongnu.org; Mon, 03 Dec 2018 04:29:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19045) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gTkXw-0004Lp-6h for qemu-devel@nongnu.org; Mon, 03 Dec 2018 04:29:44 -0500 From: Markus Armbruster References: <20181029125733.14597-1-marcandre.lureau@redhat.com> <20181029125733.14597-3-marcandre.lureau@redhat.com> <87in0b84r6.fsf@dusky.pond.sub.org> Date: Mon, 03 Dec 2018 10:29:39 +0100 In-Reply-To: (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Mon, 3 Dec 2018 12:04:00 +0400") Message-ID: <8736rf6jr0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/6] monitor: accept chardev input from iothread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: Paolo Bonzini , QEMU , Peter Xu , "Dr. David Alan Gilbert" Marc-Andr=C3=A9 Lureau writes: > Hi > > On Mon, Dec 3, 2018 at 11:26 AM Markus Armbruster wro= te: >> >> Marc-Andr=C3=A9 Lureau writes: >> >> > Chardev backends may not handle safely IO events from concurrent >> > threads. >> >> What exactly could go wrong? Or is this a well-known fact that doesn't >> need further elaboration? > > chardev are not thread-safe. Only the write path is, since commit > 9005b2a7589540a3733b3abdcfbccfe7746cd1a1. Add this to your commit message? Your call. >> "safely handle I/O events" >> >> > Better to wake up the chardev from the monitor IO thread if >> > it's being used as the chardev context. >> > >> > Unify code paths by using a BH in all cases. >> > >> > Drop the now redundant aio_notify() call. >> > >> > Signed-off-by: Marc-Andr=C3=A9 Lureau [...]