From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932501AbcGFWwb (ORCPT ); Wed, 6 Jul 2016 18:52:31 -0400 Received: from smtprelay0112.hostedemail.com ([216.40.44.112]:40106 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752522AbcGFWwa (ORCPT ); Wed, 6 Jul 2016 18:52:30 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:7903:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12295:12296:12438:12517:12519:12555:12740:13069:13146:13161:13229:13230:13311:13357:13439:13894:14181:14659:14721:21080:21325:21433,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: pump97_4fc82c293ef06 X-Filterd-Recvd-Size: 2582 Message-ID: <1467845547.8360.43.camel@perches.com> Subject: Re: [PATCH v3 7/7] dynamic_debug: add jump label support From: Joe Perches To: Jason Baron , akpm@linux-foundation.org Cc: peterz@infradead.org, linux-kernel@vger.kernel.org Date: Wed, 06 Jul 2016 15:52:27 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-07-06 at 17:42 -0400, Jason Baron wrote: > Although dynamic debug is often only used for debug builds, sometimes its > enabled for production builds as well. Minimize its impact by using jump > labels. This reduces the text section by 7000+ bytes in the kernel image > below. It does increase data, but this should only be referenced when > changing the direction of the branches, and hence usually not in cache. > >    text    data     bss     dec     hex filename > 8194852 4879776  925696 14000324  d5a0c4 vmlinux.pre > 8187337 4960224  925696 14073257  d6bda9 vmlinux.post Maybe to get some of that space back on the 32 bit builds the 8 byte alignment can be relaxed. > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h [] > @@ -33,6 +37,12 @@ struct _ddebug { >  #define _DPRINTK_FLAGS_DEFAULT 0 >  #endif >   unsigned int flags:8; > +#ifdef HAVE_JUMP_LABEL > + union { > + struct static_key_true dd_key_true; > + struct static_key_false dd_key_false; > + } key; > +#endif >  } __attribute__((aligned(8))); Couldn't this be: } __aligned(__alignof__(void *));   > @@ -60,7 +70,7 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, >     const struct net_device *dev, >     const char *fmt, ...); >   > -#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ > +#define DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, key, init) \ >   static struct _ddebug  __aligned(8) \ >   __attribute__((section("__verbose"))) name = { \ And this shouldn't need the __aligned as it's already in the structure definition. Maybe: static struct _ddebug __section(__verbose) name = { >   .modname = KBUILD_MODNAME, \