Since unmade_cohorts is a signed number (the code contains an underflow
check), the result of the '%' operator could be negative and result in
"#-999999", which would overflow the buffer, truncating the last digit.
freelists AND the per-CPU pgflcache free pages caches, and that is the
number of pages that the pagedaemon considers to be available.
However, most pages in the pgflcache per-CPU free page caches are NOT
actually available for any particular allocation, and thus allocating
a page can fail even though the pagedaemon thinks enough pages are
available. This change makes CPU_COUNT_FREEPAGES only count pages in
the global freelists and not pages in the pgflcache per-CPU free page
caches, thus better aligning the pagedaemon's view of how many pages
are available with the number of pages that can actually be allocated
by any particular request. This fixes a hang that Christos was hitting.
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.
In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.
On Alpine Linux, the output was not in the same order as on NetBSD,
at least since bmake-20200902.
The mixture of block-buffered output from child processes and make
itself was hard to predict anyway. Switching to line-buffered stdout
improves the stability of the tests.
The variable names are still confusing. There was no useful
documentation on the struct, and the code in SuffAddSrc is highly
redundant. Maybe the next few refactorings will shed light on this part
of the code.
The FD_* macros from sys/sys/fd_set.h use signed integers on NetBSD 8
and thus produce conversion errors. On NetBSD 9, these macros are fixed
to use 1U instead of 1.
The header make.h is not only used by usr.bin/make but also by
usr.bin/xinstall, to get the needshell function.
That program does not declare the variables noRecursiveExecute and
noExecute, leading to an "unresolved reference" at link time. To fix
this, move the inline functions away from make.h.
It's a quirk that make.h gets included by other programs since it
contains a whole lot of definitions that are only useful in make itself.
If any, there should be a separate header that defines the public
library API of make, and only that.
Revert rev 1.122:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_bio.c#rev1.122
If this commit is applied to NFS client, changes to files in client
side are sometimes invisible in server side, which results in file
corruption.
Demonstrated by test code provided by Anthony Mallet:
https://mail-index.netbsd.org/current-users/2020/10/17/msg039708.html
Whether the test case above passes or not depends on architectures
and size of NFS I/O specified by -r and -w options of mount_nfs(8)
(the default size is 32KB for x86 and 8KB for other archs).
Whereas it fails on amd64 and i386 with the default size, it passes
on other archs (aarch64, arm, alpha, m68k, and powerpc at least) with
their default. On most ports, it fails with some I/O sizes.
However, the condition for failure is still unclear; whereas it fails
with 2KB I/O size on amiga (m68k, 8KB page), it passes with same I/O
size on alpha (8KB page). It may depends on some VM parameters or
details in pmap implementation, or some race conditions are involved.
Great thanks to Anthony Mallet for providing the test code, and sorry
everyone for breakage.
This way it's easier to see whether an expected variable is missing, or
to compare the values of related variables, since they usually share a
common prefix. Any sorting criterion is better than the hash code.
Sorting the variables by name changed the order of the output in
varname.mk. That test didn't test anything meaningful, it was just a
playground to understand and demonstrate the current implementation of
how the variables are stored, therefore it has been removed.
When a system call in a child process failed, there was no guarantee
that the error message would be written completely. Using writev
correctly is harder than building the string in a buffer and then
writing it in the traditional way.
According to POSIX 2004, using memory allocation or even calling
write(2) from the child process invokes undefined behavior. The
remaining code from make has done all this for several years now,
successfully, therefore adding one more of that won't hurt.
Make still tries to write the error message atomically by passing the
whole buffer at once to write(2), just as in the previous writev(2)
implementation.