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] [day] [month] [year] [list]
Date:	Tue, 24 Apr 2012 23:46:41 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Minho Ban <mhban@...sung.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Paul Turner <pjt@...gle.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [RFC/PATCH] Prevent wasting time to find out get_parent_ip

On Wed, Apr 25, 2012 at 12:21:36PM +0900, Minho Ban wrote:
> On 04/25/2012 08:45 AM, Josh Triplett wrote:
> > On Wed, Apr 25, 2012 at 08:31:24AM +0900, Minho Ban wrote:
> >> On 04/24/2012 09:53 PM, Peter Zijlstra wrote:
> >>> On Tue, 2012-04-24 at 21:36 +0900, Minho Ban wrote:
> >>>> trace_preempt_on/off looks empty if PREEMPT_TRACER is off. But actually it is
> >>>> spending time to find out get_parent_ip(even CALLER_ADDR for some ARCH) which is
> >>>> in argument. This seems not fair for those who expect to do nothing but increase
> >>>> or decrease count.
> >>>
> >>> You can do the same by making them CPP macros and adding a comment as to
> >>> why they're macros instead of inlines..
> >>>
> >>
> >> Thank you for pointing this out, certainly macros look better. I'll amend this.
> > 
> > As an alternative, how about making get_parent_ip and its called
> > functions static inlines?  Then the compiler can eliminate them via dead
> > code elimination.
> > 
> > Or, how about declaring get_parent_ip with the GCC "pure" attribute?
> > That would tell GCC that it can safely eliminate calls to the function.
> > 
> > - Josh Triplett
> > 
> 
> Thank you for alternative method, but I'm afraid this could not cover the CALLER_ADDR.

As far as I can tell, CALLER_ADDR() always means ftrace_caller(), and
CALLER_ADDR[0-6] always reference __builtin_return_address() or
return_address().  In the former case, you could mark ftrace_caller
pure, and in the latter cases, if GCC for some reason generates code for
those without eliminating it as dead code, you could add trivial
wrappers around those functions that have the pure attribute set on
them.  That should allow GCC to completely eliminate all of those.

Would that work?

- Josh Triplett
--
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