From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbdGCIQi (ORCPT ); Mon, 3 Jul 2017 04:16:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33940 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbdGCIQf (ORCPT ); Mon, 3 Jul 2017 04:16:35 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B2370E1EE2 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B2370E1EE2 Subject: Re: [PATCH 3/3] KVM: LAPIC: Fix lapic timer injection delay To: Wanpeng Li Cc: "linux-kernel@vger.kernel.org" , kvm , Radim Krcmar , Wanpeng Li References: <1498755501-39602-1-git-send-email-pbonzini@redhat.com> <1498755501-39602-4-git-send-email-pbonzini@redhat.com> <20be1e98-deec-ea00-32e1-251781a35f83@redhat.com> From: Paolo Bonzini Message-ID: Date: Mon, 3 Jul 2017 10:16:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 03 Jul 2017 08:16:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/2017 10:08, Wanpeng Li wrote: >> Yeah, I'm not entirely satisfied with it but it's working: start_sw >> timer will see ktimer->pending and do nothing. >> >> But thinking more about it, maybe the "if (r)" can be omitted >> completely? We need to benchmark it but it can be done. > "if (r)" makes codes more understandable, in addition, calling expired > the pending timer here looks weird though ktimer->pending. We can remove the call to apic_timer_expired too (sorry if I was too terse). :) start_sw_period and start_sw_tscdeadline would take care of it. Paolo