r358262 imp Feb. 23, 2020, 7:04 p.m.
TARGET_ARCH is only for use in Makefile.inc1 contexts. MACHINE_ARCH is the
preferred thing to set.  Makefile.inc1 sets MACHINE_ARCH in the cross build
case, and make sets it in the native build case. This will fix anybody doing a
native build. Add a comment for why we have to do this dance so when/if the
problem with CFLAGS is fixed for the kernel this workaround can be removed.
r358261 markj Feb. 23, 2020, 5:59 p.m.
The minimum allocation size of 4 blocks is an old policy that came with
the "new" swap pager in r42957.  Since then the blist allocator has
gotten better at reducing fragmentation; for example, with r349777 it
can return a range that spans multiple leaves.  When swap space is close
to being exhaused, the minimum of 4 blocks most likely exacerbates
memory pressure, so reduce it to 1.

Reported by:	alc
Tested by:	pho
Reviewed by:	alc, dougm, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23763
r358260 tsoome Feb. 23, 2020, 3:21 p.m.
We may want to find out why alloc_pread() failed.
r358258 rlibby Feb. 23, 2020, 3:32 a.m.
Quiet a variety of Wwrite-strings warnings in sys/kern at low-impact
sites.  This patch avoids addressing certain others which would need to
plumb const through structure definitions.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D23798
r358257 rlibby Feb. 23, 2020, 3:32 a.m.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D23797
r358256 rlibby Feb. 23, 2020, 3:32 a.m.
Discussed with:	kib
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D23796
r358254 sevan Feb. 22, 2020, 11:36 p.m.
NetBSD-7 branch wont be receiving any more releases.
r358252 kib Feb. 22, 2020, 8:50 p.m.
If node attribute returned in the reply for read rpc indicate
truncation, and it happens that the vnode is exclusively locked,
update of the node attributes would try to shrink vnode size.  Since
during the read some vnode pages were busied by the reading thread,
vnode_pager_setsize() deadlocks waiting for the busy state owned by
the caller.

Use a thread-local flag to indicate that NFS read owns some (s)busy
pages states and postpone the call to vnode_pager_setsize() until the
thread relinguishes the ownership.

Diagnosed by:	rlibby
Tested by:	pho, rlibby
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
r358251 kib Feb. 22, 2020, 8:43 p.m.
There is no more free bits in td_pflags.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
r358250 salvadore Feb. 22, 2020, 5:56 p.m.
Approved by:	gerald (mentor)
r358249 markj Feb. 22, 2020, 5:44 p.m.
It is already internally handled as a pointer to a const string, in
particular by uma_zcreate().

Fix indentation while here.

MFC after:	1 week
r358248 kevans Feb. 22, 2020, 4:20 p.m.
This provides the needed hint to GCC and offers an annotation for readers to
observe that it's in-fact impossible to hit this point. We'll get hit with a
a -Wswitch error if the enum applicable to the switch above were to get
expanded without the new value(s) being handled.
r358247 kp Feb. 22, 2020, 1:23 p.m.
MACHINE_ARCH sets the hw.machine_arch sysctl in the kernel. In userspace
it sets MACHINE_ARCH in bmake, which bsd.cpu.mk uses to configure the
target ABI for ports.

For riscv64sf builds (i.e. soft-float) that needs to be riscv64sf, but
the sysctl didn't reflect that. It is static.

Set the define from the riscv makefile so that we correctly reflect our
actual build (i.e. riscv64 or riscv64sf), depending on what TARGET_ARCH
we were built with.

That still doesn't satisfy userspace builds (e.g. bmake), so check if
we're building with a software-floating point toolchain there. That
check doesn't work in the kernel, because it never uses floating point.

Reviewed by:	philip (previous version), mhorne
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D23741
r358237 kevans Feb. 22, 2020, 4:02 a.m.
We've grown to also require libthr and libprivatestd to be explicitly linked
in here, so do this now to fix freebsd-wifi-build.

Submitted by:	Pavel Timofeev <timp87 gmail com>
r358236 jeff Feb. 22, 2020, 3:44 a.m.
This enables very cheap read sections with free-to-use latencies and memory
overhead similar to epoch.  On a recent AMD platform a read section cost
1ns vs 5ns for the default SMR.  On Xeon the numbers should be more like 1
ns vs 11.  The memory consumption should be proportional to the product
of the free rate and 2*1/hz while normal SMR consumption is proportional
to the product of free rate and maximum read section time.

While here refactor the code to make future additions more

Name the overall technique Global Unbound Sequences (GUS) and adjust some
comments accordingly.  This helps distinguish discussions of the general
technique (SMR) vs this specific implementation (GUS).

Discussed with:	rlibby, markj