lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 Jan 2012 11:28:37 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [RFC][PATCH] tracing/module: Move tracepoint out of module.h


* Steven Rostedt <rostedt@...dmis.org> wrote:

> On Mon, 2012-01-23 at 09:29 +1030, Rusty Russell wrote:
> > > could just move the "if" part out.
> > 
> > Agreed.  Since GCC should be able to eliminate that branch in almost all
> > cases, since it's usually a literal NULL or address of a (non-weak)
> > symbol.
> > 
> > Be interesting to see the before/after sizes with this out-of-line.
> 
> Using my default test config I got:
> 
>    text	   data	    bss	    dec	    hex	filename
> 7489488	2249584	9719808	19458880	128eb40	vmlinux-prepatch
> 7482458	2248048	9719808	19450314	128c9ca	vmlinux-postpatch
> 
> An 8k savings!

Lovely!

> @@ -445,8 +444,7 @@ static inline void __module_get(struct module *module)
>  {
>  	if (module) {
>  		preempt_disable();
> -		__this_cpu_inc(module->refptr->incs);
> -		trace_module_get(module, _THIS_IP_);
> +		inc_module(module, _THIS_IP_);
>  		preempt_enable();
>  	}
>  }
> @@ -458,10 +456,9 @@ static inline int try_module_get(struct module *module)
>  	if (module) {
>  		preempt_disable();
>  
> -		if (likely(module_is_live(module))) {
> -			__this_cpu_inc(module->refptr->incs);
> -			trace_module_get(module, _THIS_IP_);
> -		} else
> +		if (likely(module_is_live(module)))
> +			inc_module(module, _THIS_IP_);
> +		else
>  			ret = 0;

How much more do we save if we move all of try_module_get() out 
of line? It still seems a rather thick inline function with 
preempt section and all. I'd *really* suggest that it should all 
be uninlined.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ