Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbaL3Tot (ORCPT ); Tue, 30 Dec 2014 14:44:49 -0500 Received: from mail-bl2on0145.outbound.protection.outlook.com ([65.55.169.145]:53172 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751424AbaL3Tor (ORCPT ); Tue, 30 Dec 2014 14:44:47 -0500 X-Greylist: delayed 74368 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Dec 2014 14:44:46 EST Message-ID: <1419968672.4961.4.camel@freescale.com> Subject: Re: [PATCH] srcu: Isolate srcu sections using CONFIG_SRCU From: Scott Wood To: Pranith Kumar CC: Martin Schwidefsky , Benjamin Herrenschmidt , Paul Mackerras , "Michael Ellerman" , Heiko Carstens , "supporter:S390" , Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , "Mathieu Desnoyers" , Anton Blanchard , Andy Fleming , Tiejun Chen , Daniel Walter , "Jens Freimann" , Christian Borntraeger , "open list:LINUX FOR POWERPC..." , open list , "open list:S390" 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" X-Mailer: Evolution 3.12.7-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BLUPR05CA0068.namprd05.prod.outlook.com (10.141.20.38) To BY2PR0301MB0727.namprd03.prod.outlook.com (25.160.63.17) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0727; X-Forefront-PRVS: 04410E544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(51704005)(377424004)(199003)(24454002)(189002)(23676002)(64706001)(105586002)(68736005)(46102003)(89996001)(87976001)(103116003)(21056001)(19580405001)(40100003)(20776003)(47776003)(31966008)(99396003)(76176999)(50986999)(50466002)(86362001)(106356001)(97736003)(92566001)(77156002)(122386002)(33646002)(2950100001)(120916001)(62966003)(4396001)(107046002)(36756003)(42186005)(50226001)(19580395003)(101416001)(110136001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB0727;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2014 19:44:39.5118 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0727 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0678; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:BY2PR0301MB0678; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0678; X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 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/