pmap_growkernel(): do not panic immediately, optionally return the error
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D47935
mount_nfs: make temporary DNS failure non-fatal with background mode
Typical problem with network mounts is remote equipment not being
available when our host boots up after a power failure. Even if you
properly configure boot order of all local services and wait for link
coming up on your NIC, you still may boot faster than some intermediate
switch on the network or the DNS server itself. Let's refer to this as a
"server room boot race". For NFS mounts with hostname in hosts(5) the
race is addressed by a retry loop on NFS mount timeout. However, a DNS
resolution timeout is treated differently to NFS mount timeout. We fail
on the former and keep retrying on the latter.
With feedback received on current@, I see that the problem is so old, that
people got used to it and see it as a desired behavior rather than a
problem. And for those who is affected by the problem, they suggest
hosts(5) as a solution. Note that using hosts(5) isn't scalable, and
using bare IP addresses is neither scalable, nor compatible with
Kerberized mounts.
[9 lines not shown]
libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeout
A nameserver timeout is a soft failure, future attempts may succeed.
Returning EAI_AGAIN is crucial for API users to tell a soft name
resolution failure from negative resolution result.
Before the change we would return EAI_ADDRFAMILY, which I believe, is a
regression from 144361386696, and before that revision we used to return
EAI_NONAME in most of the cases.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D49411
(cherry picked from commit d803854bccb9ea527c1769ac403e011ff0e121e5)
release/GCE: Remember whether we mounted /dev
Don't unmount /dev inside the image if we didn't mount it. We might
end up unmounting a /dev which is still needed.
Fixes: 611c1457ff32 ("release: Add set -e to abort upon failure")
iwx: correct rx status reporting
We are currently not reporting any per-chain S:N values so remove
IEEE80211_R_C_RSSI and IEEE80211_R_RSSI along with it as it is set
already in the line above.
Sponsored by: The FreeBSD Foundation
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D50927
iwx: correct chain number reporting
There is no point in assigning the channel index to the number of
chains for the RX status reporting. The value was not tagged as
being used. Rather than simply removing it try to fix it and
set the flag if we get a value.
Sposnored by: The FreeBSD Foundation
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D50926
vm_page: eliminate a stale KASSERT
With the elimination of VM_ALLOC_NOOBJ, it became illegal to pass
VM_ALLOC_WAITOK to vm_page_alloc_contig() (and its helpers). So,
there is no point in asserting that the caller didn't pass both
VM_ALLOC_NORECLAIM and VM_ALLOC_WAITOK.
pass: Update comments about scsi and devstat
scsi is the only transport to do tag_action, so is the only one that
needs that support in devstat. Make a note of that. nvme and ata do
support some ordering, but that's done in the [an]da driver for each of
these devices and not for passthru commands and not via these tags.
Sponsored by: Netflix
pass: Use pointer to ccb header rather than longer construct
Take a pointer to the ccb header in a few places where it's not
ambiguous (eg we have multiple ccbs in the routine). The code is a
little shorter this way. In places we had mulitple ccbs, I refrained
from doing this since that's more complex to manage. This also means
that we're making a stronger guarantee to the compiler we're only
accessing this part of the ccb, which reduces a few warnings from gcc
with picky settings we normally disable for CAM).
This makes the driver slightly less SCSI specific where csio was used to
do this needlessly.
There's no functional change.
Sponsored by: Netflix
kern: send parent a SIGCHLD when the debugger has detached
The practical scenario that leads to this is porch(1) spawning some
utility and sending it a SIGSTOP as a debugging aide. The user then
attaches a debugger and walks through how some specific input is
processed, then detaches to allow the script to continue. When ptrace
is detached, the process resumes execution but the parent is never
notified and may be stuck in wait(2) for it to continue or terminate.
Other platforms seem to re-suspend the process after the debugger is
detached, but neither behavior seems unreasonable. Just notifying the
parent that the child has resumed is a relatively low-risk departure
from our current behavior and had apparently been considered in the
past, based on pre-existing comments.
Move p_flag and p_xsig handling into childproc_continued(), as just
sending the SIGCHLD here isn't really useful without P_CONTINUED set
and the other caller already sets these up as well.
[2 lines not shown]
sys: Correct osreldate descriptions
The kern.osreldate sysctl reports the kernel version, not a release
date. Also correct a comment about /usr/include/osreldate.h.
Reviewed by: kp, olce
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50938
net80211: in ieee80211_sta_join() only do_ht if HT is avail
In ieee80211_sta_join() there are currently two ways to set
"do_ht": (1) after checking HT IEs are avail, and (2) after
checking VHT IEs are avail and we are not on 2GHz.
In the latter case no one checks that HT IEs are available and
when we hit ieee80211_ht_updateparams_final() htinfo may be NULL
and we panic.
Avoid this by only checking for VHT if do_ht was set.
No VHT without HT IEs.
While here switch do_ht to be a bool.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
PR: 287625
Fixes: 51172f62a753f
[2 lines not shown]
vm_page: Fix nofree page accounting
In commit ae10431c9833 ("vm_page: Allow PG_NOFREE pages to be freed"), I
changed the v_nofree_count counter to instead count the size of the
nofree queue, on the basis that with the ability to free nofree pages,
the size of the queue is unbounded.
The use of a counter(9) for this purpose is not really correct, as early
initialization of per-CPU counters interferes with precise accounting
that we want here. Instead, add a global tracker for this purpose,
expose it elsewhere in the sysctl tree, and restore v_free_nofree's
original use as a counter of allocated nofree pages.
Reviewed by: bnovkov, alc, kib
Reported by: alc
Fixes: ae10431c9833 ("vm_page: Allow PG_NOFREE pages to be freed")
Differential Revision: https://reviews.freebsd.org/D50877
fwget: pci_intel_video: do no log on no match
We should never "log" a statement on no match for a given device we
do not know about. We do not control the PCI ID assignments and thus
cannot predict if we would even support such a device.
This also triggers an invalid output in the installer.
Leave it as log_verbose for now.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
PR: 287639
Reviewed by: manu, emaste
Differential Revision: https://reviews.freebsd.org/D50916
arm64 pmap: use the counter(9) KPI for L2 superpages
Use the counter(9) KPI instead of atomics to maintain the L2 superpage
mapping counts. (A similar change was made to the amd64 pmap in 2021.)
While here, update the SYSCTL descriptions to reflect the possibility
that the base page size is 16KB.
tracing.7: Add a single reference point for tracing facilities in FreeBSD
FreeBSD has a fair number of tracing facilities. The new tracing(7)
manual page aims to provide a starting point for users to learn about
what is available.
Reviewed by: christos, bnovkov, markj, ziaee
Approved by: christos (mentor), bnovkov (mentor), markj (mentor)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D50854
pass: Make the name of the driver a #define
"pass" is in several places, but should be a #define. Make it one. This
also lets folks with particular needs that copy this driver to reduce
diffs.
Sponsored by: Netflix
nfsd: Fix accumulating nfslockfile structures
If a NFSv4 client does an exclusive open where the file
already exists, the server returns EEXIST. However,
without this patch, a partially filled in nfslockfile
structure is allocated, but is not referenced by any open
and, as such, never gets freed.
This patch fixes the bug by checking for EEXIST before
calling nfsvno_open().
(cherry picked from commit 1749465947a807caa53ce09b90a30b820eaab62e)
bridge: fix vlan(4) on a bridge member
If an interface is a bridge member, and a vlan(4) is also created on
that interface, and net.link.bridge.member_ifaddrs=0, then vlan(4)
will never see any incoming frames because bridge doesn't pass them
to the host for processing.
Work around this by checking for locally-addressed frames using the
MAC address of the interface we received the frame on, but only if
the frame has a .1q tag and there's a vlan trunk on the interface.
This behaviour is almost certainly "wrong" and it's not clear if we
really want to support this, but it did work in the past and the
member_ifaddrs change was not supposed to break it, so this restores
the previous behaviour.
PR: 287150
MFC after: 1 week
Reviewed by: kevans, des
[4 lines not shown]
stand: userboot: allow building on !x86
We can still get plenty of use out of a userboot that doesn't know
anything about how to load or boot a kernel; notably, the test harness
in tools/boot can still be used to test lua changes.
Hack out the necessary bits to simply build on other platforms, and add
a small warning with ample time to view the warning on other platforms.
We still won't build userboot by default on these platforms, since the
build product isn't useful for most people.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41529
audit: move the wait from the queue length from the commit to alloc
AUDIT_SYSCALL_EXIT() and indirectly audit_commit() is intended to be
called from arbitrary top-level context. This means that any sleepable
locks can be owned by the caller, and which makes the sleeping in
audit_commit() forbidden.
Since we need to sleep for the record in audit_alloc() anyway, move the
sleep for the queue limit there. At worst, if the audit is suspended is
disabled when we actually reach the commit location, this means that we
lost time uselessly.
PR: 287566
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50879
sched_ule: 32-bit platforms: Fix runq_print() after runq changes
The compiler would report a mismatch between the format and the actual
type of the runqueue status word because the latter is now
unconditionally defined as an 'unsigned long' (which has the "natural"
platform size) and the format expects a 'size_t', which expands to an
'unsigned int' on 32-bit platforms (although they are both of the same
actual size).
This worked before as the C type used depended on the architecture and
was set to 'uint32_t' aka 'unsigned int' on these 32-bit platforms.
Just fix the format (use 'l'). While here, remove outputting '0x' by
hand, instead relying on '#' (only difference is for 0, and is fine).
runq_print() should be moved out of 'sched_ule.c' in a subsequent
commit.
Reported by: Jenkins
[4 lines not shown]