From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753053AbbCXAUv (ORCPT ); Mon, 23 Mar 2015 20:20:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45529 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbbCXAUs (ORCPT ); Mon, 23 Mar 2015 20:20:48 -0400 Date: Mon, 23 Mar 2015 21:17:44 -0300 From: Marcelo Tosatti To: Radim =?utf-8?B?S3LEjW3DocWZ?= Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH] KVM: x86: inline kvm_ioapic_handles_vector() Message-ID: <20150324001743.GA16287@amt.cnet> References: <1426798361-14982-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1426798361-14982-1-git-send-email-rkrcmar@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 19, 2015 at 09:52:41PM +0100, Radim Krčmář wrote: > An overhead from function call is not appropriate for its size and > frequency of execution. > > Suggested-by: Paolo Bonzini > Signed-off-by: Radim Krčmář > --- > I'm not very fond of that smp_rmb(): there is no real synchronization > against update_handled_vectors(), Yes, because the guest OS should provide synchronization (it should shutdown interrupts before attempting to modify IOAPIC table). The smp_wmb is necessary. > so the only point I see is to drop > cached value of handled_vectors, which seems like bad use of LFENCE. test_bit has volatile on *addr, so don't see why the smp_rmb is necessary at all. Applied, thanks.