Page MenuHomeFreeBSD

Partially depessimize userspace memmove, memcpy and bcopy
ClosedPublic

Authored by mjg on Sep 14 2018, 2:41 AM.
Tags
None
Referenced Files
F103476046: D17167.id48031.diff
Mon, Nov 25, 12:45 PM
Unknown Object (File)
Sun, Nov 24, 12:26 PM
Unknown Object (File)
Wed, Nov 20, 5:40 AM
Unknown Object (File)
Tue, Nov 19, 12:48 PM
Unknown Object (File)
Tue, Nov 19, 11:18 AM
Unknown Object (File)
Tue, Nov 19, 10:43 AM
Unknown Object (File)
Tue, Nov 19, 8:10 AM
Unknown Object (File)
Tue, Nov 19, 8:06 AM
Subscribers

Details

Summary

The current routines are extremely crude and trivially can get the same benefit as kernel variants (pre-ERMS) in https://svnweb.freebsd.org/base?view=revision&revision=334537

The forward jump overhead when it is needed is pretty much negligible compared to the extra rep spinning up.

Note that decent versions of these routines would be very different than kernel ones as they should possibly use simd, either way there is no point trying to move them all into a shared file.

memset requires a little bit more work and will be dealt with separately

Test Plan

ran buildworld and kyua tests. intentionally reverting conditions in either forward or backwards case brings instant failures.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Is the same change useful for 'copy backward' part ?

I think i386 should be synced with the amd64 change.

mjg edited the test plan for this revision. (Show Details)
  • also modify copying backwards. did not do it for simplicity, this already has to be reworked.

I don't have any i386 hardware to benchmark on and without it I prefer to not speculate. If there is a 'building to run on amd64' flag I can test for, I'm happy to add it ifdef-ed.

In D17167#365955, @mjg wrote:
  • also modify copying backwards. did not do it for simplicity, this already has to be reworked.

I don't have any i386 hardware to benchmark on and without it I prefer to not speculate. If there is a 'building to run on amd64' flag I can test for, I'm happy to add it ifdef-ed.

You do have i386 hardware, it is the same machine as you use for amd64 testing. But I do not even propose to boot i386 kernel, just test using the lib32 libraries, 'cc -m32 ... '. I do not see a need to for ifdef for that change on i386. IMO, the main target for userspace i386 is amd64 host.

  • cover i386, installed the 32-bit world and chrooted inside, works fine

Please renumber local labels so that they are in order of appearance. You can do it as a follow-up commit.

This revision is now accepted and ready to land.Sep 16 2018, 9:06 AM
This revision was automatically updated to reflect the committed changes.