From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZA7r-0001af-F6 for qemu-devel@nongnu.org; Fri, 09 Dec 2011 18:45:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZA7q-0003u2-NP for qemu-devel@nongnu.org; Fri, 09 Dec 2011 18:45:11 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:50626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZA7q-0003tx-IS for qemu-devel@nongnu.org; Fri, 09 Dec 2011 18:45:10 -0500 Received: by qcsd15 with SMTP id d15so3092066qcs.4 for ; Fri, 09 Dec 2011 15:45:09 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 9 Dec 2011 23:45:09 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] QEMU TB Unlinking due to interrupt. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xin Tong Cc: qemu-devel On 9 December 2011 18:44, Xin Tong wrote: > Currently, QEMU unchains TBs if there is an interrupt pending. I would > like to know whether there is any reason behind this ? (why not > checking interrupt status in the beginning of every tb ?) The theory is that it's faster overall to do a slightly slow operation (tb unlinking) on interrupts rather than do a check at the beginning of every tb (happens a lot in the normal code path). However the tb unlinking code is racy and personally I think we should get rid of it in favour of a simpler scheme like a flag check. I have some prototype patches kicking around for this. -- PMM