| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
OK claudio@
|
|
|
|
|
|
|
|
|
| |
* Use .Vt for struct names and other type names like in_port_t.
* Use .Dv for #define'd constants like CPUSTATES and KERN_SYSVIPC_INFO.
* Use .Va for sysctl variable names like "machdep".
Not touching some of the .Li use related to networking; that stuff
looks suspicious in more than one way and a diff would need review.
|
|
|
|
| |
ok kn
|
|
|
|
|
|
|
|
|
|
|
|
| |
tsleep(9)'s maximum timeout shrinks as HZ grows, so this ensures we do
not return early from longer timeouts on alpha or on custom kernels.
POSIX says you cannot return early unless a signal is delivered, so
this makes us more compliant with the standard.
While here, remove the 100 million second upper bound. It is an
artifact from itimerfix() and it serves no discernible purpose.
ok tedu@ visa@
|
| |
|
| |
|
|
|
|
| |
unveil calls should follow. ok various, including jmc
|
|
|
|
|
|
| |
now that there is essentially no malloc.conf;
text tweaked by deraadt; ok otto deraadt
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because of hw.smt we need a way to determine whether a given CPU is "online"
or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be
cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS
with an extensible struct. At the moment it's just KERN_CPTIME2 with a
flags member, but it can grow as needed.
KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are
few (if any) packages in the wild still using the symbol so breakage in ports
should be near zero. No other system inherited the symbol from BSDi, either.
Then, use the new sysctl(2) in systat(1) and top(1):
- systat(1) draws placeholder marks ('-') instead of percentages for
offline CPUs in the cpu view.
- systat(1) omits offline CPU ticks when drawing the "big bar" in
the vmstat view. The upshot is that the bar isn't half idle when
half your logical CPUs are disabled.
- top(1) does not draw lines for offline CPUs; if CPUs toggle on or
offline in interactive mode we redraw the display to expand/reduce
space for the new/missing CPUs. This is consistent with what some
top(1) implementations do on Linux.
- top(1) omits offline CPUs from the totals when CPU totals are
combined into a single line (the '-1' flag).
Originally prompted by deraadt@. Discussed endlessly with deraadt@,
ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also
discussed with jca@. Earlier versions tested by jmc@, tb@, and many
others.
docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@,
"Is your stuff in yet?" deraadt@
|
|
|
|
|
|
| |
It also translated a documented send(2) EACCES case erroneously.
This was too much magic and always prone to errors.
from Jan Klemkow; man page jmc@; OK claudio@
|
|
|
|
|
|
|
| |
posix file locks is defined. Also, detect overflows when dealing with positive
lengths.
ok millert@ visa@
|
| |
|
| |
|
| |
|
|
|
|
| |
OK benno@
|
|
|
|
|
|
|
| |
unveil for each unveil in the process at unveil() time, and refactoring the
handling of current directory and ISDOTDOT to be much more sensible.
Worked out at ns2k18 with guenther@.
ok deraadt@
|
|
|
|
| |
ok mpi@ jca@
|
|
|
|
| |
more uniform; potential for confusion noticed by aalm@; OK jmc@.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Not a strictly portable use of the interface and there are more suitable
interfaces for timeouts anyway.
ok schwarze millert
|
|
|
|
| |
ok beck jmc
|
| |
|
|
|
|
| |
unveil for relative operations) that I am working on in BUGS
|
| |
|
| |
|
|
|
|
| |
the amount of modal verbs going on;
|
|
|
|
| |
okay mestre@
|
|
|
|
| |
OK millert@ deraadt@ and jmc@ who also gave me a cluebat stick
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
"See witness(4)" is unneccessary, and just bulks this already large page: remove it;
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents a panic due to a double free if a program exits after having
called accept(2) and dup2(2) on the same fd but without the corresponding
connect(5).
It will also allows us to simplify file descriptor locking. The error code
has been choosed to match Linux's behavior.
Pointed by Mathieu on tech@ after a discussion with guenther@. ok visa@
|
| |
|
|
|
|
| |
Reminded by jmc@
|
|
|
|
| |
ok krw@
|
|
|
|
| |
Prodded by and ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Discussing with mpi@ and guenther@, we decided to first fix the existing
semaphore implementation with regards to SA_RESTART and POSIX compliant
returns in the case where we deal with restartable signals.
Currently we return EINTR everywhere which is mostly incorrect as the
user can not know if she needs to recall the syscall or not. Return
ECANCELED to signal that SA_RESTART was set and EINTR otherwise.
Regression tests pass and so does the posixsuite. Timespec validation
bits are needed to pass the later.
OK mpi@, guenther@
|
| |
|
|
|
|
|
|
| |
describe how an inner-region is found for applying MAP_STACK, and that
currently MAP_STACK remains set when the sigaltstack is disabled.
ok kettenis guenther schwarze
|
|
|
|
|
| |
that aren't even small bugs. And stop talking about AF_LOCAL.
Feedback and OK guenther@, OK jmc@.
|
|
|
|
| |
OK deraadt
|
|
|
|
|
|
|
| |
(unknown to me) relevant ordering of the various promises; restore
them now to their original order;
partial revert requested by deraadt too
|