From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbdGCHac (ORCPT ); Mon, 3 Jul 2017 03:30:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40156 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdGCHa3 (ORCPT ); Mon, 3 Jul 2017 03:30:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 182423D94F Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 182423D94F 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> From: Paolo Bonzini Message-ID: <20be1e98-deec-ea00-32e1-251781a35f83@redhat.com> Date: Mon, 3 Jul 2017 09:30:19 +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.30]); Mon, 03 Jul 2017 07:30:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/07/2017 03:56, Wanpeng Li wrote: >>> - if (!apic_lvtt_period(apic) && atomic_read(&ktimer->pending)) >>> + if (!apic_lvtt_period(apic) && (r || atomic_read(&ktimer->pending))) { >>> + if (r) >>> + apic_timer_expired(apic); >>> return false; >>> + } >> >> This logic is not the same as in my v4 >> http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1434040.html >> . You return false for the expired timer and actually it will switch >> to sw timer. > > Ah, I miss read it, the rebase is correct. 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. Paolo