From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDrK2-0000Vu-Ap for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:20:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDrJy-0005gK-DR for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:20:38 -0500 Received: from mail-wj0-x22d.google.com ([2a00:1450:400c:c01::22d]:36560) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cDrJx-0005fx-Ue for qemu-devel@nongnu.org; Mon, 05 Dec 2016 06:20:34 -0500 Received: by mail-wj0-x22d.google.com with SMTP id qp4so287228185wjc.3 for ; Mon, 05 Dec 2016 03:20:33 -0800 (PST) References: <14abb3dd-b639-3c31-cade-073fff209ca6@redhat.com> <20161129132354.GF15786@lemon> <04fa01e1-0613-fc14-527b-e3432c6fec1a@redhat.com> <20161129141746.GA2043@lemon> <20161129152428.4w6c6fuate4eouc5@kamzik.brq.redhat.com> <20161129153944.GA11237@lemon> <20161129160123.t55xzd3ggqnlcpsj@kamzik.brq.redhat.com> <07abf6bb-ec21-da2c-bc8c-c9f136ba5c01@redhat.com> <20161129193828.cbzvz5iya7pjms44@kamzik.brq.redhat.com> <20161130090534.jor25j4hnec7dlbp@kamzik.brq.redhat.com> <3677a5ef-a01c-b867-178b-8287017176d3@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <3677a5ef-a01c-b867-178b-8287017176d3@redhat.com> Date: Mon, 05 Dec 2016 11:20:31 +0000 Message-ID: <871sxm1v28.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Linux kernel polling for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Andrew Jones , Fam Zheng , Eliezer Tamir , "Michael S. Tsirkin" , QEMU Developers , Jens Axboe , Christian Borntraeger , Stefan Hajnoczi , Davide Libenzi , Christoph Hellwig Paolo Bonzini writes: > On 30/11/2016 10:46, Peter Maydell wrote: >>> > The problem is indeed with the scheduling. The way it currently works >>> > is to depend on the iothread to kick a reschedule once in a while, or >>> > a cpu to issue an instruction that does so (wfe/wfi). However if >>> > there's no io and a cpu never issues a scheduling instruction, then it >>> > won't happen. We either need a sched tick or to never have an infinite >>> > iothread ppoll timeout (basically using the ppoll timeout as a tick). >> Ah yes, that one. I thought Alex had a patch which added >> a timer to ensure that we don't allow a single guest >> TCG vCPU to hog the execution thread, but maybe I'm >> misremembering. > > Yes, it's part of MTTCG. The patch itself is: tcg: add kick timer for single-threaded vCPU emulation It's not really part of MTTCG as it can be applied without reference to the MTTCG work. However it is a pre-requisite to the iothread mutex rework that MTTCG requires which would otherwise break the single threaded case which currently relies on the side-effect to trigger scheduling. > > Paolo -- Alex Bennée