public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: libelf-0.175 breaks objtool
Date: Fri, 10 Apr 2020 10:46:37 +1000	[thread overview]
Message-ID: <20200410004637.GU24067@dread.disaster.area> (raw)
In-Reply-To: <CAK8P3a1mg=53Ab9ZWtRvPSWxq-BUxdsFE2O0FbZeh1++F40mVQ@mail.gmail.com>

On Thu, Apr 09, 2020 at 10:25:14AM +0200, Arnd Bergmann wrote:
> On Thu, Apr 9, 2020 at 9:41 AM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Tue, Apr 07, 2020 at 08:44:11PM +0200, Arnd Bergmann wrote:
> > > That is very possible. The -g has been there since xfs was originally merged
> > > back in 2002, and I could not figure out why it was there (unlike the
> > > -DSTATIC=""
> > > and -DDEBUG flags that are set in the same line).
> > >
> > > On the other hand, my feeling is that setting -g should not cause problems
> > > with objtool, if CONFIG_DEBUG_INFO is ok.
> >
> > I suspect we shouldn't force -g ourselves in xfs.  Care to send a patch?
> 
> Done.
> 
> On a related topic, I noticed how the CONFIG_DEBUG flag used to control
> whether functions marked STATIC get inlined or not, but now they are always
> marked noinline, apparently in an attempt to get more readable object code
> even when not debugging. I also see that during early v2.6, XFS used
> 'STATIC' almost exclusively, while newly added functions tend to use plain
> 'static' instead.
> 
> Is this something worth revisiting to see if inlining would make a difference
> to performance or are you reasonably sure it does not?

The "noinline" here is really "noinline_for_stack", but it predates
the noinline_for_stack annotation and never got updated. i.e.
the noinline was added because of the historic stack usage problems
we had with 4k stacks on x86 and 8k stacks on x86-64. We had to
split large functions up to reduce the number of on-stack variables
in them, but that was then being undone by the compiler deciding to
automatically inline single use static functions.

I know the x86-64 stack issues have gone away now we have
CONFIG_VMAP_STACK, but people can still turn that off so we still
have to be careful about stack usage caused by inlining single use
functions...

Hence I'm not sure we can just remove this - we'd need to go back
and investigate what impact it has on stack usage in the writeback
allocation path and other historic problematic code paths to
determine if they should still be annotated or not. They could be
converted with s/STATIC/static noinline_for_stack/ on a case by case
basis, and then the rest could probably just be case converted with
sed...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2020-04-10  0:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190205133821.1a243836@gandalf.local.home>
     [not found] ` <20190206021611.2nsqomt6a7wuaket@treble>
     [not found]   ` <20190206121638.3d2230c1@gandalf.local.home>
     [not found]     ` <CAK8P3a1hsca02=jPQmBG68RTUAt-jDR-qo=UFwf13nZ0k-nDgA@mail.gmail.com>
     [not found]       ` <20200406221614.ac2kl3vlagiaj5jf@treble>
     [not found]         ` <CAK8P3a3QntCOJUeUfNmqogO51yh29i4NQCu=NBF4H1+h_m_Pug@mail.gmail.com>
     [not found]           ` <CAK8P3a2Bvebrvj7XGBtCwV969g0WhmGr_xFNfSRsZ7WX1J308g@mail.gmail.com>
     [not found]             ` <20200407163253.mji2z465ixaotnkh@treble>
2020-04-07 18:44               ` libelf-0.175 breaks objtool Arnd Bergmann
2020-04-07 19:30                 ` Arnd Bergmann
2020-04-09  7:41                 ` Christoph Hellwig
2020-04-09  8:25                   ` Arnd Bergmann
2020-04-10  0:46                     ` Dave Chinner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200410004637.GU24067@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=arnd@arndb.de \
    --cc=hch@infradead.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox