From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752794AbdF2MOH (ORCPT ); Thu, 29 Jun 2017 08:14:07 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35223 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbdF2MOA (ORCPT ); Thu, 29 Jun 2017 08:14:00 -0400 Subject: Re: [PATCH v3] KVM: LAPIC: Fix lapic timer injection delay To: Wanpeng Li Cc: "linux-kernel@vger.kernel.org" , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li References: <1498613352-4651-1-git-send-email-wanpeng.li@hotmail.com> <68c0d7f8-683f-c7fa-b328-e90e8dd9a789@redhat.com> <6fc8f133-15b8-3ee2-1483-614642deffa0@redhat.com> <62c6b468-52c0-38c5-e15f-c770483188cd@redhat.com> From: Paolo Bonzini Message-ID: <0949cae5-d010-48c6-e54d-f59a38d09600@redhat.com> Date: Thu, 29 Jun 2017 14:13:55 +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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/06/2017 14:05, Wanpeng Li wrote: > + /* In case the sw timer triggered in the window */ > + if (!apic_lvtt_period(apic)) { > + if (r || atomic_read(&apic->lapic_timer.pending)) { > + need_cancel = true; > + if (r) > + apic_timer_expired(apic); > + } > + } Yes, that's equivalent. The compiler should thread the jumps as if it were: if (r) { apic_timer_expired(apic); goto cancel_timer; } if (atomic_read(&apic->lapic_timer.pending)) goto cancel_timer; so it produces pretty good code too. Paolo