From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0115.outbound.protection.outlook.com [65.55.169.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 64CE61A0490 for ; Wed, 31 Dec 2014 06:44:52 +1100 (AEDT) Message-ID: <1419968672.4961.4.camel@freescale.com> Subject: Re: [PATCH] srcu: Isolate srcu sections using CONFIG_SRCU From: Scott Wood To: Pranith Kumar Date: Tue, 30 Dec 2014 13:44:32 -0600 In-Reply-To: References: <1419700667-24888-1-git-send-email-bobby.prani@gmail.com> <20141229110324.50f1339b@mschwide> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Cc: "open list:S390" , Lai Jiangshan , Christian Borntraeger , "open list:LINUX FOR POWERPC..." , Heiko Carstens , Josh Triplett , Steven Rostedt , open list , Tiejun Chen , Jens Freimann , Paul Mackerras , Anton Blanchard , Andy Fleming , Martin Schwidefsky , "supporter:S390" , "Paul E. McKenney" , Daniel Walter , Mathieu Desnoyers List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2014-12-29 at 23:32 -0500, Pranith Kumar wrote: > 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. asm-offsets.c is unusual in that respect, and I think most of those ifdefs could go away without breaking anything (head_booke.h is not a normal header file, and kvm_book3s.h should just be removed as it will be pulled in by kvm_ppc.h if applicable). > 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. As I suggested elsewhere in the thread, why not be more fine-grained in what you ifdef in the srcu header? How will that require excessive refactoring? Or, just stick with the linker error. I also wonder if this is worthwhile just to save around 2000 bytes. What other core synchronization mechanisms are optional? What real-world configs will actually have this disabled? -Scott