Age | Commit message (Collapse) | Author |
|
to a cloned device.
ok kettenis@
|
|
a bad/corrupt binary not returning ENOEXEC but some other error.
ok guenther kettenis bluhm
|
|
later on, and it makes no sense for a binary to have such a segment.
ok bluhm@, guenther@
|
|
|
|
side effect pending signals specifically sent to the main thread
were handled by other threads. This made gcj in textproc/pdftk
port build stall.
Noticed and tested by espie@.
|
|
parameter should be declared uint64_t and not int.
From & for semarie@ who isn't committing at the moment and ok beck@
who is on the road.
|
|
by the unveil diff. Noticed at, and diff from semarie@
|
|
NULL in this path so free will return early without accessing it.
ok jca@ tb@
|
|
|
|
so that people don't get screwed when playing with it on their
machines
|
|
This brings unveil into the tree, disabled by default - Currently
this will return EPERM on all attempts to use it until we are
fully certain it is ready for people to start using, but this
now allows for others to do more tweaking and experimentation.
Still needs to send the unveil's across forks and execs before
fully enabling.
Many thanks to robert@ and deraadt@ for extensive testing.
ok deraadt@
|
|
The introduction of hw.smt means that logical CPUs can be disabled
after boot and prior to suspend/resume. If hw.smt=0 (the default),
there needs to be a way to count the number of hardware threads
available on the system at any given time.
So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it.
hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu()
during boot, while hw.ncpuonline is equal to the number of CPUs available
to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN
equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu.
This is preferable to adding a new sysctl to count the number of
configured CPUs and keeping hw.ncpu equal to the number of online
CPUs because such a change would break software in the ecosystem
that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like.
Such software in base includes top(1), systat(1), and snmpd(8),
and perhaps others.
We don't need additional locking to count the cardinality of a cpuset
in this case because the only interfaces that can modify said cardinality
are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK.
Software using HW_NCPU/hw.ncpu to determine optimal parallism will need
to be updated to use HW_NCPUONLINE/hw.ncpuonline. Until then, such software
may perform suboptimally. However, most changes will be similar to the
change included here for libcxx's std::thread:hardware_concurrency():
using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining
optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN
is insufficient.
Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen.
Lots of patch tweaks from kettenis.
ok kettenis, "proceed" deraadt
|
|
to the process, it is made pending at the main thread. There it
could hang forever. So also check the main thread for signal
delivery. This workaround fixes hung tests in posixtestsuite. The
proper solution would be to split pending signals for process and
threads.
input visa@; OK guenther@
|
|
OK kettenis@ visa@ mpi@
|
|
variables can be delared constant.
OK claudio@ mpi@
|
|
ok visa@, tb@
|
|
instead of passing sendsig() the code+type+val, pass a siginfo_t*
to copy from. Eliminate the indirection through struct emul for
sendsig(); we no longer have a SunOS4-compat version of sendsig()
ok deraadt@
|
|
|
|
OK henning@ benno@
|
|
the memory in uvm. Another process could use the false 0 then. To
be on the safe side, protect all access to ku_indx and ku_pagecnt
with a mutex. Update ku_indx and ku_pagecnt before calling
uvm_km_free(). Update ksp after uvm_km_free() to keep accounting
correct.
tested by sthen@; OK mpi@ visa@ deraadt@
|
|
to ioctl(TIOCSPGRP). The ioctl handlers expect a pointer to an int, so
read the argument into a local int variable and pass the variable's
address to the handler instead of referencing SCARG(uap, arg) directly.
OK guenther@, mpi@
|
|
OK anton@, mpi@
|
|
VOP_SETATTR() does not release the vnode lock (and it has never done
the unlocking in the past). Therefore spec_setattr() has to keep the
argument vnode locked and unlock v_specparent instead after the nested
VOP_SETATTR() call.
Fixes a WITNESS panic found by anton@
OK anton@, mpi@
|
|
error that would happen otherwise when a traced and stopped
multithreaded process is forced to exit. The error shows up as a kernel
panic when WITNESS is enabled. Without WITNESS, the error causes
a system hang.
sched_exit() has expected that a single KERNEL_UNLOCK() would release
the lock completely. That assumption is wrong when an exit happens
through the signal tracing logic:
sched_exit
exit1
single_thread_check
single_thread_set
issignal <-- KERNEL_LOCK()
userret <-- KERNEL_LOCK()
syscall
The error is a regression of r1.216 of kern_sig.c.
Panic reported and fix tested by Laurence Tratt
OK mpi@
|
|
|
|
malloc(9) is apparently not mpsafe as found the hardway by sthen@.
|
|
duplicate allocation that could happen in the future when each socket
has a dedicated lock. Right now, the code path is serialized also by
the NET_LOCK() (and the KERNEL_LOCK()).
OK mpi@
|
|
paths create kernel threads. This will be utilized by sosplice()
for the taskq allocation.
OK mpi@
|
|
during name lookup, the directory vnode was not released. Add a
vrele() to the error return path. NetBSD has added a vput() there
after we imported the check.
OK krw@ visa@
|
|
files that aren't vnodes. Move the vnode-specific code into its own
function. Add an implementation for the "DMA buffers" that can be used
by DRI3/prime code to find out the size of the graphics buffer.
This implementation is very limited and only supports offset 0 and only
for SEEK_SET and SEEK_END. This doesn't really make sense; implementing
stat(2) would be a more obvious choice. But this is what Linux does.
ok guenther@, visa@
|
|
descriptor belonging to a cloned device.
ok kettenis@
|
|
OK mpi@
|
|
instead of using a mutex for update serialization. Use a per-fdp mutex
to manage updating of file instance pointers in the `fd_ofiles' array
to let fd_getfile() acquire file references safely with concurrent file
reference releases.
OK mpi@
|
|
OK mpi@
|
|
This prevents the array from being freed too early. In the function
unp_internalize(), the locking also ensures the per-fdp flags stay
coherent with the file instance.
OK mpi@
|
|
a CPU.
ok deraadt@
|
|
|
|
found by visa@.
|
|
system calls.
OK mpi@
|
|
|
|
This is possible now that the code doing file refcounting is mp-safe.
Tested by many, ok tb@, visa@
|
|
This reduces the contention of the `w_mtx' lock.
OK mpi@
|
|
to dupfdopen() has already been registered with fd_used() in fdalloc().
The duplicate call distorted the number of open file descriptors
returned by getdtablecount(2) if a file was opened via /dev/fd/.
While there, assert that the file instance should already be in the
file list.
OK mpi@
|
|
between processes using file descriptors. This provides an alternative to
eporting them with guesable 32-bit IDs. This implementation does not (yet)
allow sharing of graphics buffers between GPUs.
ok mpi@, visa@
|
|
This lets other threads of the process modify the file descriptor
table even if the vn_open(9) call blocks.
The change has an effect on dup2(2) and dup3(2). If the new descriptor
is the same as the one reserved by an unfinished open(2), the system
call will fail with error EBUSY. The accept(2) system call already
behaves like this.
Issue pointed out by art@ via mpi@
Tested in a bulk build by ajacoutot@
OK mpi@
|
|
Commiting now to help refactoring of DRI3 and diskmap rewrite.
ok visa@, kettenis@ as part of a larger diff.
|
|
tracking work without locks.
OK kettenis@, deraadt@
|
|
OK bluhm@, jca@
|
|
Rename the int array `fdp' to `fds', and use the name `fdp' for
a variable that points to the filedesc struct of the current process.
This use of `fdp' puts unp_externalize() in line with filesystem code.
OK millert@, kettenis@
|
|
|