From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHHAs-0006dm-PE for qemu-devel@nongnu.org; Mon, 20 Jul 2015 15:56:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHHAn-0001nz-Pt for qemu-devel@nongnu.org; Mon, 20 Jul 2015 15:56:30 -0400 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:36533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHHAn-0001nq-IH for qemu-devel@nongnu.org; Mon, 20 Jul 2015 15:56:25 -0400 Received: by wgbcc4 with SMTP id cc4so45838458wgb.3 for ; Mon, 20 Jul 2015 12:56:23 -0700 (PDT) Sender: Paolo Bonzini References: <1437370031-9070-1-git-send-email-pbonzini@redhat.com> <20150720163620.GN12675@stefanha-thinkpad.redhat.com> From: Paolo Bonzini Message-ID: <55AD50E9.7060208@redhat.com> Date: Mon, 20 Jul 2015 21:50:01 +0200 MIME-Version: 1.0 In-Reply-To: <20150720163620.GN12675@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] AioContext: fix broken placement of event_notifier_test_and_clear List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, famz@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com On 20/07/2015 18:36, Stefan Hajnoczi wrote: >> > >> > i/o thread vcpu thread worker thread >> > --------------------------------------------------------------------- >> > lock_iothread >> > notify_me = 1 >> > ... >> > unlock_iothread >> > lock_iothread >> > notify_me = 3 >> > ppoll >> > notify_me = 1 >> > bh->scheduled = 1 >> > event_notifier_set >> > event_notifier_test_and_clear >> > ppoll >> > *** hang *** > I don't understand this diagram. Why is event_notifier_test_and_clear() > called by the vcpu thread? event_notifier_set() was called *after* vcpu > thread's ppoll() returned so I wouldn't expect the vcpu thread to see > the notify. > > Was there a previous notify pending? Yes, for example a bottom half could have rescheduled itself. Paolo