Replace preexec_fn=os.setsid with start_new_session=True in PosixCommand
and IOSCommand. Both call setsid() in the child before exec so
os.killpg() can terminate the whole process group on timeout, but
start_new_session=True avoids running a Python callback in the child of
a multi-threaded worker (a documented deadlock risk) and lets
subprocess.Popen use vfork() instead of fork() on Linux.
On a full mjsunit pass (default variant, x64.release, -j32), this
reduces CPU time by ~9-10% (-12% system time, ~6-7 ms per test) and wall
time by ~7%, with identical test results.
TAG=agy
CONV=27a1690b-7f9b-495b-8ad4-dd989d7f50bd
Change-Id: I741c440d7d1328f93117236f0842df565dd73abd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8541630
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#110504}