Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1484193 > unrolled thread

Re: [PATCH] lockdep: Quiet gcc about dangerous __builtin_return_address() operations

Started bySteven Rostedt <rostedt@goodmis.org>
First post2016-09-15 16:00 +0200
Last post2016-09-15 17:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] lockdep: Quiet gcc about dangerous  __builtin_return_address() operations Steven Rostedt <rostedt@goodmis.org> - 2016-09-15 16:00 +0200
    Re: [PATCH] lockdep: Quiet gcc about dangerous  __builtin_return_address() operations Peter Zijlstra <peterz@infradead.org> - 2016-09-15 16:10 +0200
      Re: [PATCH] lockdep: Quiet gcc about dangerous  __builtin_return_address() operations Steven Rostedt <rostedt@goodmis.org> - 2016-09-15 17:20 +0200

#1484193 — Re: [PATCH] lockdep: Quiet gcc about dangerous __builtin_return_address() operations

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-09-15 16:00 +0200
SubjectRe: [PATCH] lockdep: Quiet gcc about dangerous __builtin_return_address() operations
Message-ID<shFmO-7Jn-13@gated-at.bofh.it>
Peter,

Can you pull this patch in? It probably should go to stable as well.

-- Steve


On Thu, 8 Sep 2016 20:33:13 +0200
Borislav Petkov <bp@alien8.de> wrote:

> On Thu, Sep 08, 2016 at 12:34:33PM -0400, Steven Rostedt wrote:
> > [
> >   Boris, does this quiet gcc for you?
> >   I haven't fully tested this yet, as I still don't have a compiler
> >   that does the warning.  
> 
> gcc 6.x should be available in your distro...
> 
> > Gcc's new warnings about __builtin_return_address(n) operations with
> > n > 0 is popping up around the kernel. The operation is dangerous, and
> > the warning is "good to know". But there's instances that we use
> > __builtin_return_address(n) with n > 0 and are aware of the issues,
> > and work around them. And its used mostly for tracing and debugging. In
> > these cases, the warning becomes a distraction and is not helpful.
> > 
> > To get better lock issue traces, a function like get_lock_parent_ip()
> > uses __builtin_return_address() to find the caller of the lock, and
> > skip over the internal callers of the lock itself. Currently it is only
> > used in the kernel/ directory and only if certain configs are enabled.
> > 
> > Create a new config called CONFIG_USING_GET_LOCK_PARENT_IP that gets
> > selected when another config relies on get_lock_parent_ip(), and this
> > will now enable the function get_lock_parent_ip(), otherwise it wont be
> > defined. It will also disable the frame-address warnings from gcc in
> > the kernel directory.
> > 
> > Reported-by: Borislav Petkov <bp@alien8.de>  
> 
> 	  -and-tested-by: me
> 
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>  
> 
> Thanks Steve!
> 

[toc] | [next] | [standalone]


#1484213

FromPeter Zijlstra <peterz@infradead.org>
Date2016-09-15 16:10 +0200
Message-ID<shFwu-822-49@gated-at.bofh.it>
In reply to#1484193
On Thu, Sep 15, 2016 at 09:54:50AM -0400, Steven Rostedt wrote:
> 
> Peter,
> 
> Can you pull this patch in? It probably should go to stable as well.

I'm not sure how this relates to lockdep, which is why I mostly ignored
the patch.

[toc] | [prev] | [next] | [standalone]


#1484299

FromSteven Rostedt <rostedt@goodmis.org>
Date2016-09-15 17:20 +0200
Message-ID<shGCe-dP-19@gated-at.bofh.it>
In reply to#1484213
On Thu, 15 Sep 2016 16:08:10 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Thu, Sep 15, 2016 at 09:54:50AM -0400, Steven Rostedt wrote:
> > 
> > Peter,
> > 
> > Can you pull this patch in? It probably should go to stable as well.  
> 
> I'm not sure how this relates to lockdep, which is why I mostly ignored
> the patch.

It's basically about get_lock_parent_ip() which is used for backtraces
of locks, and thus for debugging locks, so I really didn't know what to
label it as. Should the subject then just be:

   lock stack traces: ...

??

-- Steve

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web