Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753723AbaD0Lyz (ORCPT ); Sun, 27 Apr 2014 07:54:55 -0400 Received: from mail-ee0-f43.google.com ([74.125.83.43]:46825 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbaD0Lyx (ORCPT ); Sun, 27 Apr 2014 07:54:53 -0400 Date: Sun, 27 Apr 2014 13:54:48 +0200 From: Ingo Molnar To: Oren Twaig Cc: Andi Kleen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Shai Fultheim Subject: Re: [PATCH v2] X86: Hook apic vector allocation domain only when interrupt routing are set to ignore Message-ID: <20140427115448.GB22116@gmail.com> References: <1398376326-3055-1-git-send-email-oren@scalemp.com> <20140425142248.GL8874@tassilo.jf.intel.com> <535CAA77.4000405@scalemp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <535CAA77.4000405@scalemp.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 * Oren Twaig wrote: > Hi Andi, > > On 04/25/2014 05:22 PM, Andi Kleen wrote: > >> +static int irc = 1; > > > > Using a static for such state is very unusual. You need to > > describe what protects it against races and why that is needed > > over a cleaner solution. > > The only reason I've used a static variable is because I wanted to > avoid inserting another code/functions which are depended on > CONFIG_PCI. The code is used once during initialization and hence > cannot be racy. > > But, if static variables are unusual (new at linux kernel), [...] They aren't unusual at all - Andi Kleen is a known to troll x86 discussions time and again with random input, just ignore it when you get bad advice. > [...] I will change the flow to read the HW state again (using the > PCI functions). Please let me know if that is desirable. No, being slower is not desirable. Maybe name the flag in a clearer fashion (the term 'irc' is used for something entirely different, most of the time), i.e. make sure it's very obvious that it's a set-once init flag. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/