Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758849AbcJZLSD (ORCPT ); Wed, 26 Oct 2016 07:18:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46204 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758146AbcJZLPt (ORCPT ); Wed, 26 Oct 2016 07:15:49 -0400 Subject: Re: [PATCH 6/5] KVM: x86: fix periodic lapic timer with hrtimers To: Wanpeng Li , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1477304593-3453-1-git-send-email-wanpeng.li@hotmail.com> <20161024150323.GB2247@potion> <20161024152737.GB3197@potion> <20161025114334.GD3197@potion> Cc: "linux-kernel@vger.kernel.org" , kvm , Yunhong Jiang , Wanpeng Li From: Paolo Bonzini Message-ID: <13aa20e8-2931-8817-1d07-7bda8f28fb19@redhat.com> Date: Wed, 26 Oct 2016 13:15:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 26 Oct 2016 11:15:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1007 Lines: 31 On 26/10/2016 12:23, Wanpeng Li wrote: >> > >> > if (apic_lvtt_oneshot(apic) && >> > - ktime_after(apic->lapic_timer.target_expiration, >> > - apic->lapic_timer.timer.base->get_time())) { >> > + !ktime_after(apic->lapic_timer.target_expiration, >> > + apic->lapic_timer.timer.base->get_time())) { >> > apic_timer_expired(apic); >> > return; >> > } >> > >> > Paolo, can you squash that? > It seems that squash is impossible since the dependency of current > kvm/queue(KVM: x86: use ktime_get instead of seeking the > hrtimer_clock_base), I will send out a separate patch to fix this. It is squashed in: + if (apic_lvtt_oneshot(apic) && + ktime_after(apic->lapic_timer.timer.base->get_time(), + apic->lapic_timer.target_expiration)) { + apic_timer_expired(apic); + return; + } Notice that the order of the arguments is inverted (alternatively I could have used ktime_before). Paolo