Messages in this thread | | | Date | Tue, 5 Jun 2018 20:22:43 +0300 | From | Alexey Dobriyan <> | Subject | Re: x86/asm: __clear_user() micro-optimization (was: "Re: [GIT PULL] x86/asm changes for v4.18") |
| |
On Tue, Jun 05, 2018 at 05:05:14PM +0200, Ingo Molnar wrote: > > * Linus Torvalds <torvalds@linux-foundation.org> wrote: > > > On Mon, Jun 4, 2018 at 5:21 AM Ingo Molnar <mingo@kernel.org> wrote: > > > > > > - __clear_user() micro-optimization (Alexey Dobriyan) > > > > Was this actually tested? > > I'm not sure - Alexey? > > > I think one reason people avoided the constant was that on some > > microarchitecture it ended up being a separate uop just for the > > constant generation, because it wouldn't fit in a single uop.
> Ok, fair point and agreed - if Alexey sends some measurements to back the change > I'll keep this, otherwise queue up a revert.
Tested? :^) I had P4 maybe ~15(?) years ago.
godbolt.org earliest compiler is 4.1.2 and it generates "movb [r32], imm8" with "-m32 -O2 -march=pentium4" for simple memset-style loop if it counts for something.
Actually I think __clear_user should be rewritten in C with assembly. It's biggest user is probably ELF loader and those partial page .bss clears should be noticeable.
| |