From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9x1o-0001lO-Gm for qemu-devel@nongnu.org; Mon, 06 Jun 2016 12:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9x1k-00048w-OR for qemu-devel@nongnu.org; Mon, 06 Jun 2016 12:05:23 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:38459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9x1k-00048n-3h for qemu-devel@nongnu.org; Mon, 06 Jun 2016 12:05:20 -0400 Received: by mail-wm0-x230.google.com with SMTP id m124so78746093wme.1 for ; Mon, 06 Jun 2016 09:05:20 -0700 (PDT) From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Mon, 06 Jun 2016 17:05:32 +0100 Message-ID: <8760tmi9pv.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC v3 13/19] tcg: rename tcg_current_cpu to tcg_current_rr_cpu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, serge.fdrv@gmail.com, cota@braap.org, bobby.prani@gmail.com, mark.burton@greensocs.com, jan.kiszka@siemens.com, rth@twiddle.net, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite Paolo Bonzini writes: > On 03/06/2016 22:40, Alex Bennée wrote: >> +/* Kick the currently round-robin scheduled vCPU */ >> +static void qemu_cpu_kick_rr_cpu(void) >> +{ >> + CPUState *cpu; >> + do { >> + cpu = atomic_mb_read(&tcg_current_rr_cpu); >> + if (cpu) { >> + cpu_exit(cpu); >> + } >> + } while (cpu != atomic_mb_read(&tcg_current_rr_cpu)); >> +} > > Interesting way to get rid of the global exit_request. I like it, but > could you get stuck on NULL tcg_current_rr_cpu now? If tcg_current_rr_cpu is still NULL when you read the second time (i.e. hasn't changed) then we'll exit the loop and your don't really need to do anything as your outside the vCPU TCG code. > > I think you should redo these two patches like this: > > - rename qemu_cpu_kick_no_halt to qemu_cpu_kick_rr_cpu and > tcg_current_cpu to tcg_current_rr_cpu; possibly move functions around > That is this patch isn't it? > - extract handle_icount_deadline Sure I can do that separately. > > - then everything else in patches 13 and 14, squashed I was wondering after I posted if I should split all the current_cpu stuff out as I don't think I need it straight away... > > Paolo -- Alex Bennée