HomeFreeBSD

powerpc: Optimize copyinstr() to avoid repeatedly mapping user strings

Description

powerpc: Optimize copyinstr() to avoid repeatedly mapping user strings

Currently copyinstr() uses fubyte() to read each byte from userspace.
However, this means that for each byte, it calls pmap_map_user_ptr() to
map the string into memory. This is needlessly wasteful, since the
string will rarely ever cross a segment boundary. Instead, map a
segment at a time, and copy as much from that segment as possible at a
time.

Measured with the HPT pmap on powerpc64, this saves roughly 8% time on
buildkernel, and 5% on buildworld, in wallclock time.

Details

Provenance
jhibbitsAuthored on Jun 4 2020, 6:15 PM
pkubajCommitted on Dec 30 2020, 10:45 PM
Parents
rGadf79abc35ff: Radix dump updates
Branches
Unknown
Tags
Unknown