[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231117121805.GEZVdZ/QhoeBytHf5o@fat_crate.local>
Date: Fri, 17 Nov 2023 13:18:05 +0100
From: Borislav Petkov <bp@...en8.de>
To: Jakub Jelinek <jakub@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
kernel test robot <oliver.sang@...el.com>,
oe-lkp@...ts.linux.dev, lkp@...el.com,
linux-kernel@...r.kernel.org,
Christian Brauner <brauner@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>,
Christian Brauner <christian@...uner.io>,
Matthew Wilcox <willy@...radead.org>,
David Laight <David.Laight@...lab.com>, ying.huang@...el.com,
feng.tang@...el.com, fengwei.yin@...el.com,
linux-toolchains ML <linux-toolchains@...r.kernel.org>,
Richard Biener <rguenther@...e.de>,
Michael Matz <matz@...e.de>, Jan Hubicka <hubicka@....cz>
Subject: Re: [linus:master] [iov_iter] c9eec08bac: vm-scalability.throughput
-16.9% regression
+ SUSE gcc folks.
On Fri, Nov 17, 2023 at 01:09:55PM +0100, Jakub Jelinek wrote:
> Sure. -mstringop-strategy affects only x86 expansion of the stringops
> from GIMPLE to RTL, while for small constant sizes some folding can happen
> far earlier in generic code. Similarly, the copy/store by pieces generic
> handling (straight-line code expansion of the builtins) is done in some
> cases without invoking the backend optabs which is the only expansion
> affected by the strategy.
> Note, the default strategy depends on the sizes, -mtune= in effect,
> whether it is -Os or -O2 etc. And the argument for -mmemcpy-strategy=
> or -mmemset-strategy= can include details on what sizes should be handled
> by which algorithm, not everything needs to be done the same.
Good to know, I might experiment with those. Thx.
> > > IOW, my assumption was just broken, and using
> > > "-mstringop-strategy=libcall" may well be the right thing to do.
> >
> > And here's where I'm wondering whether we should enable it for x86 only
> > or globally. I think globally because those stringop heuristics happen,
> > AFAIU, in the general optimization stage and thus target agnostic.
>
> -mstringop-strategy= option is x86 specific, so I don't see how you could
> enable it on other architectures.
Yeah, Richi just explained to me the same on another thread. To which
I had the question:
"Ah, it even says so in the manpage:
x86 Options ... -mstringop-strategy=alg
Ok, so how would the same option be implemented for ARM or some other
backend?
Also -mstringop-strategy=alg but it would have effect when generating
ARM code, right?
Which means, if I have it in the generic Makefile, it'll get
automatically used on ARM too when gcc implements it.
Which then begs the question whether we want that or we should let ARM
folks decide when that time comes."
I.e., what happens if we have this option in the generic Makefile and
-mstringop-strategy starts affecting ARM expansion of the stringops from
GIMPLE to RTL? Does that even make sense?
> Anyway, if you are just trying to work-around bugs in specific compilers,
> please limit it to the affected compilers, overriding kernel makefiles
> forever with the workaround would mean you force perhaps suboptimal
> expansion in various cases.
Yeah, perhaps a good idea. gcc 13 for now, I guess...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists