Age | Commit message (Collapse) | Author |
|
so that the process-level stuff is to/from struct process and not
struct proc. This fixes a bunch of problem cases in rthreads.
Based on earlier work by blambert and myself, but mostly written
at c2k10.
Tested by many: deraadt, sthen, krw, ray, and in snapshots
|
|
|
|
way a kill() intended for a thread can result in a separate process
getting the signal.
ok tedu@ art@
|
|
|
|
the now-removed HPUX compat code.
ok and build testing deraadt@
|
|
|
|
(not done) hasn't changed, but now it's less work to test things.
ok art deraadt
|
|
so stop including it in kernel .c files.
"sure" deraadt@
|
|
|
|
and struct timespec * argument. sigtimedwait is just a one line
wrapper after this.
"get it in" deraadt@, tedu@, cheers by others
|
|
ok jsing@, miod@
|
|
media just a wee bit too much.
|
|
OK miod
|
|
NetBSD.
ok kurt@, drahn@, miod@
|
|
got multiple signals before tsleep() could wakeup. Also, POSIX
says that sigwait() should never return EINTR, so map that to
ERESTART.
ok kurt@, tedu@
fixes the panic encountered by ariane@ with kaffe
|
|
that takes an additional argument "type" that indicates whether the
signal is for the process, just a particular thread, or propagated
to a thread because it's not caught or blocked. psignal() becomes
a wrapper that does the first of those.
So that sys_kill() can tell apart signals for the process and signals
for the process's original thread, the tid of the original thread
is defined as its pid + THREAD_PID_OFFSET.
ok tedu@ art@ andreas@ kurt@ "better early than late" deraadt@
|
|
signal is already pending in the calling thread or the main thread
and there's no longer a race condition where the signal could be
diverted but sigwait() would still block. There were some off-by-one
errors too.
(The checking of the main thread's pending list is just until a
pending list for the process can be added to struct process. For
now, such signals end up as pending on the main thread.)
oks tedu@ and art@
|
|
provided by christian ehrhardt (Christian_Ehrhardt@genua.de) and micky,
thanks!
ok deraadt millert
|
|
From: Pierre Riteau pierre.riteau_att_gmail.com
OK miod@
|
|
sys/dev/pci/pciide.c from naddy@
|
|
match the comment. OK deraadt@
|
|
version for i386
more architectures and ctob() replacement is being worked on
prodded by and ok miod
|
|
truncation and add an additional truncation check.
ok deraadt@ tedu@
|
|
ok tedu
|
|
makes debugging easier, docs in a bit
ok beck deraadt
|
|
|
|
- Defer the sending of SIGCHLD and waking the parent when a process goes
to sleep. We set a flag in the process "P_STOPPED" and schedule a
timeout that checks all processes for this flag and sends SIGCHLD
and wakes the parent on those processes that have this flag set.
- Delay the waking of the parent in psignal on SIGCONT until we've
released the SCHED_LOCK at the end.
- In issignal, check for P_SINTR as a way to see we were called from
the tsleep path with SCHED_LOCK locked and don't skip locking
in that case. (This is slightly ugly, but it works until we have
some better way).
miod@ ok (after finding and fixing an MD bug on sgi)
|
|
a new struct. Instead of doing a huge rename and deal with the fallout
for weeks, like other projects that need no mention, we will slowly and
carefully move things out of struct proc into a new struct process.
- Create struct process and the infrastructure to create and remove them.
- Move threads in a process into struct process.
deraadt@, tedu@ ok
|
|
it's a good idea to use atomic.h operations on it. This mechanic
change updates all bit operations on p_flag to atomic_{set,clear}bits_int.
Only exception is that P_OWEUPC is set by MI code before calling
need_proftick and it's automatically cleared by ADDUPC. There's
no reason for MD handling of that flag since everyone handles it the
same way.
kettenis@ ok
|
|
the problem with lost signals in MP kernels.
miod@, kettenis@ ok
|
|
signal to is the curproc, check if it's SONPROC. That way we'll also
signotify processes on other CPUs. This gives MD code the opportunity
to actually deliver signals to other CPUs faster than the clock
interrupt (in the worst case).
This is a NOP until MD code is fixed.
miod@ ok
|
|
effectively been a no-op for quite some time now,
without promise for future usage.
ok pedro@
Testing by krw@ (earlier diff)
and Johan Mson Lindman (tybollt@solace.miun.se)
|
|
|
|
|
|
cpu_coredump() behaviour.
|
|
discussed with a few, ok tedu@
|
|
some TIOCGPGRP result fallout.
ok deraadt@
|
|
2. when delivering a STOP or CONT signal to a process, now replicate
to every thread.
makes ^Z and fg work nicer, first noticed by peter hessler.
signals and threads are not right, but this is at least a little less wrong.
|
|
uses rfork(RFTHREAD) to create threads, which are presently processes
that are a little more tightly bound together. several new syscalls
added to facilitate a userland thread library.
all conditional on RTHREADS, currently disabled.
ok deraadt
|
|
'go for it' deraadt@
|
|
(but I tend to call it ssh localhost & now when telnetd is
history). This is more localized patch, but leaves us with
a recursive lock for protecting scheduling and signal state.
Better care is taken to actually be symmetric over mi_switch.
Also, the dolock cruft in psignal can go with this solution.
Better test runs by more people for longer time has been
carried out compared to the c2k5 patch.
Long term the current mess with interruptible sleep, the
default action on stop signals and wakeup interactions need
to be revisited. ok deraadt@, art@
|
|
|
|
everyone for the prompt review and ok of this work ;-) Yeah, that includes me
too, or maybe especially me. I am sorry.
Change the sched_lock to a mutex. This fixes, among other things, the infamous
"telnet localhost &" problem. The real bug in that case was that the sched_lock
which is by design a non-recursive lock, was recursively acquired, and not
enough releases made us hold the lock in the idle loop, blocking scheduling
on the other processors. Some of the other processors would hold the biglock though,
which made it impossible for cpu 0 to enter the kernel... A nice deadlock.
Let me just say debugging this for days just to realize that it was all fixed
in an old diff noone ever ok'd was somewhat of an anti-climax.
This diff also changes splsched to be correct for all our architectures.
|
|
no change in compiler assembly output.
|
|
|
|
|
|
for the same signal; deraadt@ ok
|
|
add stack_t and ucontext_t typedefs.
ok deraadt@
|
|
from Patrick Latifi <patrick.l@hermes.usherb.ca>
ok jason@ tedu@
|
|
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@
|