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


Groups > linux.kernel > #1592618 > unrolled thread

Question Regarding ERMS memcpy

Started byLogan Gunthorpe <logang@deltatee.com>
First post2017-03-04 22:20 +0100
Last post2017-03-05 11:00 +0100
Articles 2 on this page of 22 — 5 participants

Back to article view | Back to linux.kernel


Contents

  Question Regarding ERMS memcpy Logan Gunthorpe <logang@deltatee.com> - 2017-03-04 22:20 +0100
    Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-04 23:50 +0100
      Re: Question Regarding ERMS memcpy hpa@zytor.com - 2017-03-05 01:00 +0100
        Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 01:20 +0100
          Re: Question Regarding ERMS memcpy hpa@zytor.com - 2017-03-05 01:30 +0100
            Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 01:40 +0100
              Re: Question Regarding ERMS memcpy hpa@zytor.com - 2017-03-05 02:00 +0100
                Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 11:00 +0100
                  Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 12:20 +0100
                    Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 14:10 +0100
                  Re: Question Regarding ERMS memcpy Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-05 20:30 +0100
                    Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 21:20 +0100
                      Re: Question Regarding ERMS memcpy Linus Torvalds <torvalds@linux-foundation.org> - 2017-03-05 21:20 +0100
                      Re: Question Regarding ERMS memcpy Logan Gunthorpe <logang@deltatee.com> - 2017-03-06 08:10 +0100
                        Re: Question Regarding ERMS memcpy "H. Peter Anvin" <hpa@zytor.com> - 2017-03-06 08:40 +0100
                          Re: Question Regarding ERMS memcpy Logan Gunthorpe <logang@deltatee.com> - 2017-03-06 18:50 +0100
                            Re: Question Regarding ERMS memcpy hpa@zytor.com - 2017-03-06 20:10 +0100
                        Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-06 14:40 +0100
                          Re: Question Regarding ERMS memcpy hpa@zytor.com - 2017-03-06 14:50 +0100
                            Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-06 15:10 +0100
              Re: Question Regarding ERMS memcpy Logan Gunthorpe <logang@deltatee.com> - 2017-03-05 06:00 +0100
                Re: Question Regarding ERMS memcpy Borislav Petkov <bp@suse.de> - 2017-03-05 11:00 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1592693

FromLogan Gunthorpe <logang@deltatee.com>
Date2017-03-05 06:00 +0100
Message-ID<thwqZ-39n-3@gated-at.bofh.it>
In reply to#1592653
Hey,

On 04/03/17 05:33 PM, Borislav Petkov wrote:
> On Sat, Mar 04, 2017 at 04:23:17PM -0800, hpa@zytor.com wrote:
>> What are the compilation flags? It may be that gcc still does TRT
>> depending on this call site. I'd check what gcc6 or 7 generates,
>> though.
> Hmm, I wish we were able to say, "let gcc decide for small sizes and let
> us do the patching for larger ones."

So, I've found that my kernel config had the OPTIMIZE_FOR_SIZE selected
instead of OPTIMIZE_FOR_PERFORMANCE. I'm not sure why that is but
switching to the latter option fixes my problem. A memcpy call is used
instead of the poor inline solution. (I'm not really sure how the inline
solution even makes any sense as it almost certainly makes things larger
in the grand scheme of things.)

It still might make sense to apply your patch asking gcc to never use
the broken memcpy but I'll leave that in your capable hands to decide.

Anyway, thanks for the help with this.

Logan

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


#1592719

FromBorislav Petkov <bp@suse.de>
Date2017-03-05 11:00 +0100
Message-ID<thB7j-6NF-1@gated-at.bofh.it>
In reply to#1592693
On Sat, Mar 04, 2017 at 09:58:14PM -0700, Logan Gunthorpe wrote:
> So, I've found that my kernel config had the OPTIMIZE_FOR_SIZE selected
> instead of OPTIMIZE_FOR_PERFORMANCE. I'm not sure why that is but
> switching to the latter option fixes my problem. A memcpy call is used
> instead of the poor inline solution. (I'm not really sure how the inline
> solution even makes any sense as it almost certainly makes things larger
> in the grand scheme of things.)

Probably some gcc heuristics don't work as expected...

In any case, I have

# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set

here and it still generates REP; MOVSL in dmi_scan_machine().

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web