From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: heiko.carstens@de.ibm.com,
Yoshinori Sato <ysato@users.sourceforge.jp>,
dalias@libc.org, tony.luck@intel.com, fenghua.yu@intel.com,
msalter@redhat.com, jacquiot.aurelien@gmail.com,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
mingo@redhat.com, Pirama Arumuga Nainar <pirama@google.com>,
Greg Hackmann <ghackmann@google.com>,
Mark Salyzyn <salyzyn@google.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org,
sparclinux@vger.kernel.org
Subject: Re: Getting the instruction pointer on a per arch basis
Date: Mon, 06 Aug 2018 05:24:54 +0000 [thread overview]
Message-ID: <20180806072454.6efb5973@mschwideX1> (raw)
In-Reply-To: <CAKwvOdnAzsF_vXH4UQiQd9HwjUju_sU9R4523zxqJSphuut-7Q@mail.gmail.com>
On Wed, 1 Aug 2018 11:21:13 -0700
Nick Desaulniers <ndesaulniers@google.com> wrote:
> On Tue, Jul 31, 2018 at 10:41 PM Martin Schwidefsky
> <schwidefsky@de.ibm.com> wrote:
> >
> > On Tue, 31 Jul 2018 16:09:06 -0700
> > Nick Desaulniers <ndesaulniers@google.com> wrote:
> >
> > > + More maintainers and lists for visibility
> > >
> > > On Tue, Jul 31, 2018 at 3:32 PM Nick Desaulniers
> > > <ndesaulniers@google.com> wrote:
> > > >
> > > > I'm currently looking into cleaning up the code duplication between
> > > > current_text_addr() and _THIS_IP_, virtually every implementation of
> > > > current_text_addr() and _THIS_IP_ itself are basically:
> > > >
> > > > #define _THIS_IP_ ({ __label__ _l; _l: &&_l; })
> > > >
> > > > For a few arch's, they have inline assembly instead (for
> > > > current_text_addr()). Examples:
> > > > * s390
> > > > * sh
> > > > * ia64
> > > > * x86 (um and 32b)
> > > > * c6x
> > > > * sparc
> > > >
> > > > I have a patch that cuts down on the duplication, but I don't
> > > > understand why the few arch specific implementations are necessary. I
> > > > could reduce the duplication further if it's ok to just use the
> > > > statement expression.
> > > >
> > > > Does anyone know why this is the case?
> >
> > For s390 it is just that we did not know about the label trick when we
> > introduced the define. The inline has an advantage though, the code
> > generated with the label trick is using a LARL instruction which is
> > 4 bytes, the inline assembly uses a BASR which is 2 bytes.
> >
> > If I use the label method in current_text_addr() the size of vmlinux
> > increases by a small amount:
> >
> > add/remove: 33/13 grow/shrink: 101/48 up/down: 11941/-8887 (3054)
>
> Thanks for the measurements. Was this output produced by a utility?
Yes, ./scripts/bloat-o-meter
> > This is acceptable though, I would not mind if _THIS_IP_ and
> > current_text_addr use a common definition using labels.
>
> Thank you for this feedback Martin, I appreciate it. Patches soon.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
prev parent reply other threads:[~2018-08-06 5:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAKwvOdku_BOi6m2ugaef6=8+VH_+KAHH-Ch+uZZqMr8WAKARCw@mail.gmail.com>
2018-07-31 23:09 ` Getting the instruction pointer on a per arch basis Nick Desaulniers
2018-08-01 1:33 ` Randy Dunlap
2018-08-01 5:40 ` Martin Schwidefsky
2018-08-01 18:21 ` Nick Desaulniers
2018-08-06 5:24 ` Martin Schwidefsky [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=20180806072454.6efb5973@mschwideX1 \
--to=schwidefsky@de.ibm.com \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=fenghua.yu@intel.com \
--cc=ghackmann@google.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jacquiot.aurelien@gmail.com \
--cc=linux-c6x-dev@linux-c6x.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=msalter@redhat.com \
--cc=ndesaulniers@google.com \
--cc=pirama@google.com \
--cc=salyzyn@google.com \
--cc=sparclinux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=ysato@users.sourceforge.jp \
/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;
as well as URLs for NNTP newsgroup(s).