| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
| |
ok kettenis@ mpi@ visa@
|
|
|
|
| |
ok kettenis@ mpi@ visa@
|
|
|
|
|
|
|
| |
proc0 which is used for kthreads and idle threads. proc0 and all those
other kernel threads don't handle signals so there is no benefit in sharing.
Simplifies the code a fair bit since the refcnt is gone.
OK kettenis@
|
| |
|
|
|
|
|
|
| |
adding more filter properties without cluttering the struct.
OK mpi@, anton@
|
|
|
|
|
|
|
|
|
|
|
| |
throat of physio().
Allows individual devices to eventually be modified to support larger
physio() (a.k.a. 'raw') i/o's if they prove capable of them.
No immediate functional change.
Tested for many weeks by and ok robert@.
|
|
|
|
|
|
|
|
| |
interrupt is enough to defer the signal handling. This is a leftover
from the times where not all archs had generic soft interrupts.
It is possible that the defer signal handling to a soft interrupt will
be removed at a later stage.
Input anton@, mpi@ OK kettenis@
|
|
|
|
|
|
|
| |
Do not include <sys/kthread.h> where it is not needed and stop including
<sys/proc.h> in it.
ok visa@, anton@
|
|
|
|
|
|
| |
This makes it easier to release fdplock before calling closef().
OK mpi@, anton@
|
|
|
|
|
|
|
|
|
| |
inconsistent if knote_acquire() or knote_release() is preempted by
an interrupt that modifies the same knote.
OK mpi@
Reported-by: syzbot+8c174edc00da365121d7@syzkaller.appspotmail.com
|
|
|
|
|
|
|
|
| |
it easier to grab the kernel lock once ioctl() is unlocked.
Thanks to semarie@ who came up with an improved diff.
ok mpi@ semarie@ visa@
|
|
|
|
|
|
|
|
| |
excessive as only one command actually modifies the pipe. The sigio
subsystem is already internally protected using its own lock. This is
similar to what soo_ioctl() already does.
ok mpi@ visa@
|
|
|
|
|
|
| |
process.
ok bluhm@ claudio@ visa@
|
|
|
|
|
|
|
| |
locks. The deferring also prevents kernel stack exhaustion with deep
kqueue hierarchies.
OK anton@, mpi@
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
| |
that modifies the filesystem as inflight. This is used in the sync calls (on
suspend and hibernate) to mark filesystems clean if no work is in flight.
VOP_UNLOCK() also got the v_inflight dance but VOP_UNLOCK does not alter
filesystem space and so it does not matter if VOP_UNLOCK() is currently run.
Also VOP_UNLOCK() does not sleep so there is no way for the sync code to see
an inflight VOP_UNLOCK().
OK visa@
|
|
|
|
|
| |
VOP_LOCK with LK_DRAIN. This simplifies VOP_LOCK() a fair bit.
OK visa@
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a traced process _exit(2)s, its (tracing) parent tries to give it
back to the old parent. In the case where the old parent is the same
as the tracing parent, there's no need to do this dance, so simply
remove it from the list of zombies and free its descriptors.
Fix a double report via wait(2) exposed by recent changes in make and
newly imported ptrace(2) regression from NetBSD.
Diagnosed with espie@ and guenther@, ok claudio@
|
|
|
|
|
|
|
| |
ps_pledge more than once. That will cause problems if sys_ioctl is
changed to be unlocked (in at least some cases), so switch to a read-once
local variable.
discussed with a few, ok mpi
|
|
|
|
|
|
| |
to errors.
OK deraadt@, cheloha@, anton@
|
|
|
|
|
|
|
|
| |
invalidation in one place.
Store struct tty pointer in kn_hook directly to simplify the code.
OK mpi@
|
|
|
|
|
|
|
|
|
|
|
|
| |
fdrelease(). This makes the upper layer of file descriptor closing
free of KERNEL_LOCK() when the process does not use kqueue.
The kernel locking around fdremove() and knote_fdclose() is no longer
needed because kqueue_register() checks if there has been a race with
file descriptor close. Moreover, the locking became ineffective against
these races when filterops callbacks were allowed to sleep.
OK anton@, mpi@
|
|
|
|
| |
ok semarie, deraadt
|
| |
|
|
|
|
|
| |
operational behaviour of "go" which is not unreasonable
from Jimmy Brush
|
|
|
|
| |
asked for more oks; my bad!
|
|
|
|
|
|
|
|
|
|
| |
operating on the process structure and issuing signals. This is similar
to what sigio_setown() already does.
With this in place, the pipe subsystem is no longer required to grab the
kernel lock before calling pgsigio().
ok 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@
|
|
|
|
|
|
| |
toward MP-safety.
OK mpi@, anton@
|
| |
|
|
|
|
|
| |
Tested by krw@, anton@
OK mpi@, anton@
|
|
|
|
|
|
|
|
|
|
|
| |
Using different fields to remember in which runqueue or sleepqueue
threads currently are will make it easier to split the SCHED_LOCK().
With this change, the (potentially boosted) sleeping priority is no
longer overwriting the thread priority. This let us get rids of the
logic required to synchronize `p_priority' with `p_usrpri'.
Tested by many, ok visa@
|
|
|
|
|
|
|
| |
Add a KASSERTMSG() to check that strategy functions didn't screw
b_resid up too much.
ok beck@ tedu@
|
| |
|
|
|
|
|
|
| |
intended for shm/fd passing, but for programs that may otherwise like
filesystem access.
ok beck deraadt kettenis
|
|
|
|
| |
no function change.
|
|
|
|
|
|
|
|
| |
minphys() function check for MAXPHYS.
Feedback from tedu@ kettenis@ dlg@
ok cheloha@, robert@, jmatthew@ as part of larger diff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Furthermore the parser was unaware a NOTE could contain multiple
records. The scanner has been rewritten. Another bonus bug: if the
binary was labelled as OPENBSD ABI, NOTE parsing was completely
skipped so WXNEEDED wasn't learned either...
Now that NOTEs are scanned correctly, search for the 'Go' NOTE. (During
this work found the Go linker produces slightly broken NOTEs - Go team
will probably fix that).
Work is happening for our Go dynamic-binaries to use libc syscall
stubs, but the change isn't ready. Go (and reportedly free-pascal
also?) binaries are the only dynamic programs which require syscalls
in the main-program. Since Go binaries are now identifiable, we can
disable syscalls in all other regular dynamic-main-programs, gaining
the strict enforcement we want. When the the Go-libc-stub change
arrives we'll delete the Go NOTE scan and treat Go binaries same as
regular binaries.
This change probably breaks free-pascal, a lower priority item to repair.
some discussion with jsing, ok kettenis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We included DIAGNOSTIC in *sleep_nsec(9) when they were first committed
to help us sniff out divison-to-zero bugs when converting *sleep(9)
callers to the new interfaces.
Recently we exposed the new interface to userland callers. This has
yielded some warnings.
This diff adds a process name and pid to the warnings to help determine
the source of the zero-length sleeps.
ok mpi@
|
|
|
|
|
|
|
|
| |
dt(4) exposes kernel internals, addresses and content of states to
userland. As such its interface shouldn't be available without
enabling it consciously.
ok millert@, deraadt@
|
|
|
|
|
|
|
| |
TAILQ_CONCAT(3) apparently wasn't in-tree when this code was written.
Using it leaves us with less code *and* better performance.
ok tedu@
|
|
|
|
|
|
|
|
|
|
| |
All sleeps have been indefinite since introduction of this interface
~5 years ago, so remove the timeout argument and make indefinite sleeps
implicit.
While here: *sleep(9) -> *sleep_nsec(9)
"i don't think we're going to use timeouts [here]" tedu@, ok mpi@
|
|
|
|
| |
"i get it" deraadt@
|
|
|
|
|
|
| |
this is so pppx(4) and the upcoming pppac(4) can give kq read data
dn FIONREAD values that makes sense like the ones tun(4) and tap(4)
provide with ifq_hdatalen.
|
|
|
|
| |
ok tedu
|
|
|
|
|
|
|
|
|
|
|
| |
The design is fairly simple: events, in the form of descriptors on a
ring, are being produced in any kernel context and being consumed by
a userland process reading /dev/dt.
Code and hooks are all guarded under '#if NDT > 0' so this commit
shouldn't introduce any change as long as dt(4) is disable in GENERIC.
ok kettenis@, visa@, jasper@, deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Threads in __thrsleep(2) are tracked using queues, one queue per each
process for synchronization between threads of a process, and one
system-wide queue for the special ident -1 handling. Each of these
queues has an associated rwlock that serializes access.
The queue lock is released when calling copyin() and copyout() in
thrsleep(). This preserves the existing behaviour where a blocked copy
operation does not prevent other threads from making progress.
Tested by anton@, claudio@
OK anton@, claudio@, tedu@, mpi@
|
|
|
|
|
| |
into read-only data segment.
OK deraadt@ tedu@
|