| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The use of kqueue as backend has introduced a significant regression
in the performance of select(2), so go back to using the original code.
Some additional management overhead is to be expected when using kqueue.
However, the overhead of the current implementation is too high.
Reported by bluhm@ on bugs@
|
|
|
|
| |
OK mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The given set of fds are converted to equivalent kevents using EV_SET(2)
and passed to the scanning internals of kevent(2): kqueue_scan().
ktrace(1) will now output the converted kevents on top of the usuals set
bits to be able to find possible error in the convertion.
This switch implies that select(2) and pselect(2) will now query the
underlying kqfilters instead of the *_poll() routines.
Based on similar work done on DragonFlyBSD with inputs from from visa@,
millert@, anton@, cheloha@, thanks!
ok visa@
|
|
|
|
|
| |
if they are out of range, making it easier to isolate reason for EINVAL
ok cheloha
|
|
|
|
|
|
| |
With input from visa@.
ok visa@
|
|
|
|
|
|
|
|
|
|
|
| |
The 3 subsystems: signal, poll/select and kqueue can now be addressed
separatly.
Note that bpf(4) and audio(4) currently delay the wakeups to a separate
context in order to respect the KERNEL_LOCK() requirement. Sockets (UDP,
TCP) and pipes spin to grab the lock for the sames reasons.
ok anton@, visa@
|
|
|
|
|
|
|
|
| |
operations. Since the type of f_flag must change in order to use the
atomic(9) API, reorder the struct in order to avoid padding; as pointed
out by tedu@.
ok mpi@ visa@
|
|
|
|
|
|
|
| |
This moves most of the SCHED_LOCK() related to protecting the sleepqueue
and its states to kern/kern_sync.c
Name suggestion from jsg@, ok kettenis@, visa@
|
|
|
|
|
|
|
|
|
|
|
|
| |
FIOGETOWN/SIOCGPGRP/TIOCGPGRP. Do this by determining the meaning of
the ID parameter inside the sigio code. Also add cases for FIOSETOWN
and FIOGETOWN where there have been TIOCSPGRP and TIOCGPGRP before.
These changes allow removing the ID translation from sys_fcntl() and
sys_ioctl().
Idea from NetBSD
OK mpi@, claudio@
|
|
|
|
|
|
|
|
|
|
|
| |
When I introduced the tsleep loops in r1.23 I screwed it up and introduced
a bug: on EWOULDBLOCK we loop but fail to reset P_SELECT, so the thread
will continue to sleep but miss all relevant descriptor activity after
INT_MAX ticks have elapsed.
Spotted by mpi@ back in July.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
| |
unlocks read(2) and write(2) syscalls families, and push the KERNEL_LOCK
deeper in the code path. KERNEL_LOCK is managed per file type in fileops
handlers (fo_read, fo_write, and fo_close). read(2) and write(2) on
socket are KERNEL_LOCK-free.
initial work from mpi@ and ians@
ok mpi@ kettenis@ visa@ ians@
|
|
|
|
|
|
|
|
|
|
| |
of resource limit structs has been done between processes. By applying
copy-on-write also between threads, threads can read rlimits in
a nearly lock-free manner.
Inspired by code in DragonFly BSD and FreeBSD.
OK mpi@, agreement from jmatthew@ and anton@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the arbitrary and undocumented 24hr limits for timeouts from these
interfaces. To do so, loop tsleep(9) to chip away at timeouts larger than
what tsleep(9) can handle in one call.
Use timerisvalid(3)/timespecisvalid() for input validation instead of
itimerfix()/timespecfix() to avoid the 100 million second upper bounds
those functions introduce.
POSIX requires support for timeouts of at least 31 days for select(2) and
pselect(2), so these changes make our implementation more compliant.
Other improvements here include better variable names for the time stuff
and more consolidated timeout logic with less backwards goto jumping, all
of which made dopselect() and doppoll() a bear to read.
Naming improvements prompted by tedu@ in a prior patch for nanosleep(2).
With input from deraadt@. Validation bug spotted by matthew@ in an earlier
version.
ok visa@
|
|
|
|
|
|
|
|
|
|
|
|
| |
file operations mp-safe.
This change makes it clear that `f_offset' is only accessed in vn_read()
and vn_write(), which will help taking it out of the KERNEL_LOCK().
This refactoring uncovered a race in vn_read() which is now documented
and will be addressed in a later diff.
ok visa@
|
|
|
|
|
|
| |
NULL in this path so free will return early without accessing it.
ok jca@ tb@
|
|
|
|
| |
ok visa@, tb@
|
|
|
|
|
|
|
|
|
| |
the other fields.
Once we no longer have any [k] (kernel lock) protections, we'll be
able to unlock almost all network related syscalls.
Inputs from and ok bluhm@, visa@
|
|
|
|
| |
ok visa@
|
|
|
|
| |
ok visa@, bluhm@
|
|
|
|
| |
ok millert@ sthen@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
buffers.
This is one step towards unlocking TCP input path. Note that all the
functions asserting for the socket lock are not necessarilly MP-safe.
All the fields of 'struct socket' aren't protected.
Introduce a new kernel-only kqueue hint, NOTE_SUBMIT, to be able to
tell when a filter needs to lock the underlying data structures. Logic
and name taken from NetBSD.
Tested by Hrvoje Popovski.
ok claudio@, bluhm@, mikeb@
|
|
|
|
|
|
| |
While here document prfind(9.
with and ok guenther@
|
|
|
|
|
|
| |
initial thread
ok jsing@ kettenis@
|
| |
|
|
|
|
| |
ok guenther
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- rename _check function without suffix: a "pledge" function called from
anywhere is a "check" function.
- makes pledge_fail call the responsability to the _check function. remove it
from caller.
- make proper use of (potential) returned error of _check() functions.
- adds pledge_kill() and pledge_protexec()
with and OK deraadt@
|
|
|
|
|
|
|
|
|
| |
this check has nothing to do with pledge(2). make it lives in sys_ioctl() call.
while here, move the (fp == NULL) check early and remove duplicate check from
pledge_ioctl_check().
ok guenther@ deraadt@
|
|
|
|
|
| |
that is an errno to pass up to the calling system call instead. test
case is "who < /dev/null", via ttyname().
|
| |
|
|
|
|
|
| |
be called against a non-tty fd, so as to test "is this a tty". Discovered
by sthen and rob pierce at the same time.
|
|
|
|
|
|
| |
strict than anticipated. It allows a programmer to pledge/promise/covenant
that their program will operate within an easily defined subset of the
Unix environment, or it pays the price.
|
|
|
|
|
|
| |
layer because the strings select the right options. Mechanical
conversion.
ok guenther
|
|
|
|
| |
ok deraadt@ miod@
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pathlist is a whitelist of dirs and files; anything else returns ENOENT.
Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which
permits explicit change operations against "struct stat" fields. Some
other TAME_ flags are refined slightly.
Not cranking libc now, since nothing commited in base uses this and the
timing is uncomfortable for others. Discussed with many; thanks for a
few bug fixes from semarie, doug, guenther.
ok guenther
|
|
|
|
|
|
|
| |
sendmsg(), and recvmsg(). For cmsghdr, the len, level, and type are always
shown, and for SOL_SOCKET,SCM_RIGHTS the fd numbers being passed are shown.
ok millert@ deraadt@
|
|
|
|
|
|
| |
operating model". This is the kernel component; various changes should
proceed in-tree for a while before userland programs start using it.
ok miod, discussions and help from many
|
|
|
|
|
|
|
|
| |
Since we use the poll backend for select(2), care must be taken not
to set the fd's bit in writefds in this case. A kernel-only flag,
POLLNOHUP, is used by selscan() to tell the poll backend not to
return POLLHUP on EOF. This is currently only used by fifo_poll().
The fifofs regress now passes. OK guenther@
|
|
|
|
|
|
|
| |
followed by a mode check. This will simplify the ref/unref dance as
soon as fd_getfile() will increment fp's reference counter.
Idea from and ok guenther@, ok millert@
|
|
|
|
| |
OK guenther@
|
| |
|
|
|
|
| |
ok doug tedu
|
|
|
|
| |
tweaks and ok millert@ deraadt@
|
| |
|
| |
|
|
|
|
| |
Discussed with guenther and kettenis
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
| |
not compile-time-known page size platforms.
|
|
|
|
|
| |
don't need to be married.
ok guenther miod beck jsing kettenis
|
|
|
|
|
|
|
|
|
| |
struct ucred; struct process then directly links to the ucred
Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.
ok matthew@
|