linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@ozlabs.org
Cc: viro@zeniv.linux.org.uk, Larry.Finger@lwfinger.net
Subject: Re: powerpc/32: Avoid miscompilation w/GCC 4.6.3 - don't inline copy_to/from_user()
Date: Tue, 27 Jun 2017 12:06:34 +1000 (AEST)	[thread overview]
Message-ID: <3wxTn60wrzz9s7f@ozlabs.org> (raw)
In-Reply-To: <1498484055-13783-1-git-send-email-mpe@ellerman.id.au>

On Mon, 2017-06-26 at 13:34:15 UTC, Michael Ellerman wrote:
> Larry Finger reported that his Powerbook G4 was no longer booting with v4.12-rc,
> userspace was up but giving weird errors such as:
> 
>   udevd[64]: starting version 175
>   udevd[64]: Unable to receive ctrl message: Bad address.
>   modprobe: chdir(4.12-rc1): No such file or directory
> 
> He bisected the problem to commit 3448890c32c3 ("powerpc: get rid of zeroing,
> switch to RAW_COPY_USER").
> 
> Al identified that the problem is actually a miscompilation by GCC 4.6.3, which
> is exposed by the above commit.
> 
> Al also pointed out that inlining copy_to/from_user() is probably of little or
> no benefit, which is correct. Using Anton's copy_to_user benchmark, with a
> pathological single byte copy, we see a small increase in performance
> by *removing* inlining:
> 
>   Before (inlined):
>   # time ./copy_to_user -w -l 1 -i 10000000	( x 3 )
>   real	0m22.063s
>   real	0m22.059s
>   real	0m22.076s
> 
>   After:
>   # time ./copy_to_user -w -l 1 -i 10000000	( x 3 )
>   real	0m21.325s
>   real	0m21.299s
>   real	0m21.364s
> 
> So as a small performance improvement and to avoid the miscompilation, drop
> inlining copy_to/from_user() on 32-bit.
> 
> Fixes: 3448890c32c3 ("powerpc: get rid of zeroing, switch to RAW_COPY_USER")
> Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
> Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/d6bd8194e2867e85ac2de63486d3b8

cheers

      parent reply	other threads:[~2017-06-27  2:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 13:34 [PATCH] powerpc/32: Avoid miscompilation w/GCC 4.6.3 - don't inline copy_to/from_user() Michael Ellerman
2017-06-26 16:22 ` David Laight
2017-06-27  2:06 ` Michael Ellerman [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=3wxTn60wrzz9s7f@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=viro@zeniv.linux.org.uk \
    /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).