From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [IPv6:2607:f8b0:400c:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id A3ED21A01B2 for ; Tue, 30 Dec 2014 15:32:43 +1100 (AEDT) Received: by mail-vc0-f175.google.com with SMTP id hy10so5465418vcb.20 for ; Mon, 29 Dec 2014 20:32:40 -0800 (PST) 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 Content-Type: text/plain; charset=UTF-8 Cc: "open list:S390" , Lai Jiangshan , Tiejun Chen , Heiko Carstens , Josh Triplett , Steven Rostedt , open list , Scott Wood , Jens Freimann , Paul Mackerras , Anton Blanchard , Andy Fleming , Mathieu Desnoyers , "supporter:S390" , "Paul E. McKenney" , "open list:LINUX FOR POWERPC..." , Christian Borntraeger , Daniel Walter List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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