| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Sponsored by: Panzura
|
| |
|
|
|
|
|
| |
Add comments explaining unobvious td_critnest adjustments in
critical_exit().
|
|
|
|
|
|
| |
Note that this change substantially differs from the change in head
because of an unmerged earlier change that probably can not be merged
for POLA reasons.
|
|
|
|
| |
in r270423
|
|
|
|
|
|
|
|
|
|
| |
range m_pulldown()
m_pulldown() only needs to determine if a mbuf is writable if it is going to
copy data into the data region of an existing mbuf. It does this to create a
contiguous data region in a single mbuf from multiple mbufs in the chain. If
the requested memory region is already contiguous and nothing needs to
change, the mbuf does not need to be writeable.
|
|
|
|
| |
Clean up trailing whitespace
|
|
|
|
| |
Some style fixes for getfstat(2)-related code.
|
|
|
|
|
| |
There is no need to use temporary statfs buffer for fsid obliteration
and prison enforcement. Do it on the caller buffer directly.
|
|
|
|
| |
Style.
|
|
|
|
| |
Move common code from kern_statfs() and kern_fstatfs() into a new helper.
|
|
|
|
| |
Change knlist_destroy() to assertion.
|
|
|
|
| |
Style.
|
|
|
|
| |
Some optimizations for kqueue timers.
|
|
|
|
| |
Some style.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(by markj)
Don't increment the spin count until after the first attempt to acquire a
rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
spuriously.
==
rwlock: s/READER/WRITER/ in wlock lockstat annotation
==
sx: increment spin_cnt before cpu_spinwait in xlock
The change is a no-op only done for consistency with the rest of the file.
==
locks: change sleep_cnt and spin_cnt types to u_int
Both variables are uint64_t, but they only count spins or sleeps.
All reasonable values which we can get here comfortably hit in 32-bit range.
==
Implement trivial backoff for locking primitives.
All current spinning loops retry an atomic op the first chance they get,
which leads to performance degradation under load.
One classic solution to the problem consists of delaying the test to an
extent. This implementation has a trivial linear increment and a random
factor for each attempt.
For simplicity, this first thouch implementation only modifies spinning
loops where the lock owner is running. spin mutexes and thread lock were
not modified.
Current parameters are autotuned on boot based on mp_cpus.
Autotune factors are very conservative and are subject to change later.
==
locks: fix up ifdef guards introduced in r303643
Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct
define.
==
locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case
==
locks: fix sx compilation on mips after r303643
The kernel.h header is required for the SYSINIT macro, which apparently
was present on amd64 by accident.
|
|
|
|
|
|
|
|
|
|
| |
Microoptimize locking primitives by avoiding unnecessary atomic ops.
Inline version of primitives do an atomic op and if it fails they fallback to
actual primitives, which immediately retry the atomic op.
The obvious optimisation is to check if the lock is free and only then proceed
to do an atomic op.
|
|
|
|
|
| |
When a zombie gets reparented due to the parent exit, send SIGCHLD to
the reaper.
|
|
|
|
|
|
| |
Do not clear KN_INFLUX when not owning influx state.
PR: 214923
|
|
|
|
| |
Switch from stdatomic.h to atomic.h for kernel.
|
|
|
|
|
|
| |
Provide high precision conversion from ns,us,ms -> sbintime in kevent.
Tested by: ian
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Export the whole thread name in kinfo_proc
kinfo_proc::ki_tdname is three characters shorter than
thread::td_name. Add a ki_moretdname field for these three
extra characters. Add the new field to kinfo_proc32, as well.
Update all in-tree consumers to read the new field and assemble
the full name, except for lldb's HostThreadFreeBSD.cpp, which
I will handle separately. Bump __FreeBSD_version.
Sponsored by: Dell EMC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
thr_set_name(): silently truncate the given name as needed
Instead of failing with ENAMETOOLONG, which is swallowed by
pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
bytes. This is more likely what the user wants, and saves the
caller from truncating it before the call (which was the only
recourse).
The man page changes were not merged because thr_set_name.2
does not exist on stable/10.
Sponsored by: Dell EMC
|
|
|
|
| |
Fix WITNESS hints for pagequeue locks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The other CPU might resume and see a still-empty runq and go back to
sleep before sched_add() adds the thread to the runq. This results
in a lost wakeup and a potential hang if the system is otherwise
completely idle.
The race originated due to a micro-optimization (my fault) in 4BSD in
that it avoided putting a thread on the run queue if the scheduler was
going to preempt to the new thread. To avoid complexity while fixing
this race, just drop this optimization. 4BSD now always sets the
"owepreempt" flag when a preemption is warranted and defers the actual
preemption to the thread_unlock of the caller the same as ULE.
|
|
|
|
|
|
| |
Give the user a clue as to which process hit maxfiles.
Sponsored by: Panzura
|
|
|
|
|
| |
Provide simple mutual exclusion between mount point update and unmount.
In the update path in ffs_mount(), drop vfs_busy() reference around namei().
|
|
|
|
|
|
| |
Initialize reserved bytes in struct mq_attr.
PR: 214488
|
|
|
|
| |
Remove remnants of the recursive sleep support.
|
|
|
|
| |
Remove tautological casts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().
Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.
While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.
Tested by: Jan Henrik Sylvester <me@janh.de>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D8070
|
|
|
|
|
|
|
|
| |
Fix regression from r248371. We need to copy packet header to new
mbuf. Unlike in the pre-r248371 code, assert that M_PKTHDR is set
only on a first mbuf.
PR: 195074
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
297776:
Add a function to lookup a device_t object by name.
This just walks the global list of devices looking for one with the
requested name. The one use case outside of devctl2's implementation
is for DDB commands that wish to lookup devices by name.
297777:
Add a 'show t4 tcb <nexus> <tid>' command to dump a TCB from DDB.
This allows the contents of a TCB to be extracted from a T4/T5 card in
DDB after a panic.
297779:
Add a 'show t4 devlog <nexus>' DDB command.
This command displays the adapter's firmware device log similar to the
dev.<nexus>.misc.devlog sysctl.
Sponsored by: Chelsio Communications
|
|
|
|
|
|
| |
Use proper type for local variable.
PR: 212520
|
|
|
|
|
|
|
|
|
| |
When threads were added to the kernel, the pr_pid member of the
NT_PRSTATUS note was repurposed to store LWP IDs instead of process
IDs. However, the process ID was no longer recorded in core dumps.
This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than
bumping the prpsinfo version number, note parsers can use the note's
payload size to determine if pr_pid is present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In r10905 and r10906 makesyscalls was modified to avoid emitting a
literal $Id$ string in the generated file, with:
gsub("[$]Id: ", "", $0)
gsub(" [$]", "", $0)
Then r11294 added some functionality and also tried to address the $Id$
problem in a different way, by removing every $:
sed -e 's/\$//g ...
This rendered the gsub infeffective. The gsub was later updated to
track the $Id$ -> $FreeBSD$ switch, even though it did not do anything.
Revert the addition of the s/\$//g, and update the gsub to keep the
resulting format the same.
|
|
|
|
| |
Fix a race in vm_page_busy_sleep(9).
|
|
|
|
|
|
|
|
| |
Make no assertions about mutex state when the scheduler is stopped.
This changes the assert path to match the lock and unlock paths.
Sponsored by: Dell EMC
|
|
|
|
|
|
|
|
| |
If wait4() or wait6() return 0 because of WNOHANG, the status, rusage and
wrusage information should not be returned.
PR: 212048
Reported by: Casey Lucas
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While draining a timeout task prevent the taskqueue_enqueue_timeout()
function from restarting the timer.
Commonly taskqueue_enqueue_timeout() is called from within the task
function itself without any checks for teardown. Then it can happen
the timer stays active after the return of taskqueue_drain_timeout(),
because the timeout and task is drained separately.
This patch factors out the teardown flag into the timeout task itself,
allowing existing code to stay as-is instead of applying a teardown
flag to each and every of the timeout task consumers.
Add assert to taskqueue_drain_timeout() which prevents parallel
execution on the same timeout task.
Update manual page documenting the return value of
taskqueue_enqueue_timeout().
Differential Revision: https://reviews.freebsd.org/D8012
Reviewed by: kib, trasz
|
|
|
|
|
|
|
|
|
|
| |
posible that the queue entry it is looking at is removed
from the queue, but we make no effort to account
for this. when we wake up we need to check it's still there.
PR: 209580
Sponsored by: Panzura inc
Differential Revision: D8160
|
|
|
|
| |
Style.
|
|
|
|
|
| |
Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command
line arguments.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new 'clear driver' command for devctl along with the accompanying
ioctl and devctl_clear_driver() library routine to reset a device to
use a wildcard devclass instead of a fixed devclass. This can be used
to undo a previous 'set driver' command. After the device's name has
been reset to permit wildcard names, it is reprobed so that it can
attach to newly-available (to it) device drivers.
Sponsored by: Chelsio Communications
|
|
|
|
| |
rtc: fix inverted resolution check
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a `show panic` command to DDB which will helpfully print the
panic string again if set, in case it scrolled out of the active
window. This avoids having to remember the symbol name.
Also add a show callout <addr> command to DDB in order to inspect
some struct callout fields in case of panics in the callout code.
This may help to see if there was memory corruption or to further
ease debugging problems.
No objection by: bz
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix cleanup race between unp_dispose and unp_gc.
This change modifies the original commit to avoid changing the
domain_dispose KPI.
Tested by: Oliver Pinter
|
|
|
|
|
| |
In both do_rw_wrlock() and do_rw_rdlock(), do not obliterate possible
error from sleep.
|