Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735AbaL3Ecn (ORCPT ); Mon, 29 Dec 2014 23:32:43 -0500 Received: from mail-vc0-f169.google.com ([209.85.220.169]:37339 "EHLO mail-vc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbaL3Ecl (ORCPT ); Mon, 29 Dec 2014 23:32:41 -0500 MIME-Version: 1.0 In-Reply-To: <20141229110324.50f1339b@mschwide> References: <1419700667-24888-1-git-send-email-bobby.prani@gmail.com> <20141229110324.50f1339b@mschwide> From: Pranith Kumar Date: Mon, 29 Dec 2014 23:32:10 -0500 Message-ID: Subject: Re: [PATCH] srcu: Isolate srcu sections using CONFIG_SRCU To: Martin Schwidefsky Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , "supporter:S390" , Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Anton Blanchard , Scott Wood , Andy Fleming , Tiejun Chen , Daniel Walter , Jens Freimann , Christian Borntraeger , "open list:LINUX FOR POWERPC..." , open list , "open list:S390" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 29, 2014 at 5:03 AM, Martin Schwidefsky wrote: > On Sat, 27 Dec 2014 12:17:43 -0500 > Pranith Kumar wrote: > >> @@ -65,10 +65,13 @@ >> #include >> #include >> #include >> -#include >> #include >> #include >> >> +#if IS_ENABLED(CONFIG_KVM) >> +#include >> +#endif >> + >> #ifdef DEBUG >> #define DBG(fmt...) udbg_printf(fmt) >> #else > > I always cringe when I see an include protected by an #ifdef. > Is this really necessary? All that is done in asm-offsets.c is > to calculate offsets, the code where the two offsets in question > are used (entry64.S) does have the #ifdef for CONFIG_KVM. I agree that this is not the ideal way to do this. But, it has been the way things were already being done. If you see arch/powerpc/kernel/asm-offsets.c, there are quite some includes which are within ifdefs. I've considered other alternatives (though not in-depth) and found that they will require quite some refactoring. One simple idea is to move this #ifdef to within kvm_ppc.h. That should make the inclusion of this file a no-op in all the places where this is being included without KVM being enabled. But I am not 100% sure of that approach. Any suggestions are welcome. -- Pranith -- 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/