NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/55776: make(1) job token breakage



>Number:         55776
>Category:       bin
>Synopsis:       make(1) job token breakage
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 02 10:40:00 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        9.0, -current source date >= 2018.05.13.22.13.28
>Organization:
>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

The commit of src/usr.bin/make/job.c 1.195 removed a single statement
"wantToken = 1;" with the following commit message:

  Just skip polling job token pipe.

  The sigchld pipe ensures no busy wait.

  PR: 53285
  Reviewed by:

After this commit, a make process that is waiting for a job token will
no longer wake up when a token becomes available in another make
process in the same build.  As a result, the number of parallel jobs
specified with the "-j" option may not be achieved even though there
are enough buildable targets.

The commit in case also has multiple other issues:

 - The statement "The sigchld pipe ensures no busy wait" in the commit
   message makes no sense

 - The reference to PR 53285 is misleading, as that issue was not fixed
   by this commit

 - The actual problem that the commit was intended to fix is not stated

 - It makes the variable wantToken pointless as its value is now always zero

 - It makes the comment "If pool is empty, set wantToken so that we wake
   up when a token is released" untrue

>How-To-Repeat:

Save the following as Makefile (taking care to preserve the tabs)
and run "time make -j2":

all: target1 target2
target1:
	$(MAKE) sub1
target2:
	$(MAKE) sub2
sub1: sub1_target1 sub1_target2
sub1_target1:
	sleep 0.1
sub1_target2:
	sleep 0.1
sub2: sub2_target1 sub2_target2
sub2_target1:
	sleep 5
sub2_target2:
	sleep 5

In NetBSD 8.2, this takes about five seconds to run.  In NetBSD 9.0
and -current, which include job.c 1.195, the run time has increased to
about 10 seconds.

>Fix:

The commit should be reverted, restoring the deleted statement.



Home | Main Index | Thread Index | Old Index