From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD9L9-00064h-Tv for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:31:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD9L7-0007SI-Ec for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:31:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42070) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gD9L7-0007Rb-3V for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:31:53 -0400 References: From: Paolo Bonzini Message-ID: Date: Thu, 18 Oct 2018 16:31:47 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] Optimize record/replay checkpointing for all clocks it applies to List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artem Pisarenko Cc: qemu-devel@nongnu.org, Pavel Dovgalyuk On 18/10/2018 15:23, Artem Pisarenko wrote: >> We can also move the switch statement to a separate function, it >> simplifies the code: >> ... > > When I prepared this patch my intuition said me to add note in advance: > "Paolo, please, don't try to move this to a separate function. I've > tried it already. It cannot be done correct, look nice and not decrease > performancy at the same time". But I've ignored it... :) > Change you did is correct and nice, but (compared to my version) it adds > extra unlock/lock pair for running each timer list when it isn't empty > and in non-rr mode (where we would ignore checkpoints and execution flow > would bypass whole "if (need_replay_checkpoint) {...}" block). > Maybe you're aware of it, but I don't think that such change worth it. No, you're right. The if should remain in the caller, or need_replay_checkpoint must be initialized with replay_mode. Paolo