| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves
to struct sigacts, wihle stuff that should be per rthread (ps_oldmask,
SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping
state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread
until our locking around coredumping is better.
Oh, and remove the old SunOS-compat ps_usertramp member.
"I like the sound of this" tedu@
|
|
|
|
|
|
|
|
|
| |
a vforked child behave correctly. Have the parent in a vfork()
wait on a (different) flag in *its* process instead of the child
to prevent a possible use-after-free. When ktracing the child
return from a fork, call it rfork if an rthread was created.
ok blambert@
|
|
|
|
|
|
|
|
|
| |
knote, remove it from the process's klist; after handling those,
remove and drop any remaining knotes from the process's klist. Ban
attaching knotes to processes that have started exiting or attaching
them via the pid of a thread other than the main thread.
ok tedu@, deraadt@
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
rwlock, the thread will release biglock if it sleeps, means that
atomicity from before the rw_enter() to after it is not guaranteed.
The change didn't address those, so pulling it until it does.
"go for it" tedu@
|
|
|
|
|
| |
count was always one. That's pointless, so remove the member and the code.
ok tedu@
|
|
|
|
|
| |
(not done) hasn't changed, but now it's less work to test things.
ok art deraadt
|
|
|
|
|
|
|
|
|
|
| |
Don't set SDEAD on the process in exit1 untile we have grabbed the
allproclk. allproclk is a rwlock and thus we may sleep to grab hold of
it. This is a big of a bugger when we just set a flag that means we
panic if we sleep.
ok art@. turns Tom Murphy's fstat panic into a deadlock instead *sigh*,
this is being looked into.
|
| |
|
|
|
|
|
| |
list walkers in sysctl that can block. As a reward, no more vslock.
With some feedback from art, guenther, phessler. ok guenther.
|
|
|
|
|
|
|
|
|
| |
SIGCHLD to the tracer, even if the real parent requested an alternate
exit signal. So, delay clearing the P_TRACED flag from exit1() to
sys_wait4() so that we don't send the wrong signal from reaper().
Originally discussed with kurt months ago
"looks good" deraadt@
|
|
|
|
|
|
|
|
|
| |
and hacking on it. Since then, some of the details of finishing a
wait have changed (p_exitsig handling), so factor out the common
bit into into proc_finish_wait() and have both sys_wait4() and
svr4_sys_waitsys() call that to kill the divergence.
"looks good" deraadt@
|
|
|
|
|
|
|
|
|
|
| |
kernel so that librthread can detect when a thread is completely
done with its stack without need a kqueue. The dying thread moves
itself to a GC list, other threads scan the GC list on pthread_create()
and pthread_join() and free the stack and handle once the thread's
thread id is zeroed.
"get it in" deraadt@, tedu@, cheers by others
|
|
|
|
|
|
|
|
|
| |
sched_exit(). This means that cpu_exit() and whatever it does (for instance
calling free(), as well as the deadproc p_hash handling are now locked as well.
This may have been one of the causes of the reaper panics, especially with
rthread patches... which were terminating a lot of threads very quickly onto
the deadproc p_hash list.
ok kurt kettenis miod
|
|
|
|
|
| |
receive SIGCHLD twice if scheduled before the reaper runs. diff by
guenther@ and myself. okay guenther@ deraadt@
|
|
|
|
|
|
|
|
| |
of the struct proc* as the identifier for SEM_UNDO tracking and only
call semexit() from the original thread, once the process as a whole
is exiting
ok tedu@
|
|
|
|
|
|
|
|
| |
MD code would free resources that couldn't be freed until we were no
longer running in that processor. However, it's is unused on all
architectures since mikeb@'s tss changes on x86 earlier in the year.
ok miod@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
PR 5609, and revisited with dlg. Tested on all platforms.
ok miod
|
|
|
|
|
|
|
|
|
| |
Put a reference count in struct process to prevent use-after-free
if the main thread reaches the reaper ahead of some other thread
in the process. Use the reference count to update the user process
count correctly when changin real uid.
"please re-commit before something else nasty comes in" deraadt@
|
| |
|
|
|
|
|
|
|
| |
if the main thread reaches the reaper ahead of some other thread
in the process.
ok art@ tedu@
|
|
|
|
| |
free things when exiting a threaded proc. from philip guenther
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Move the functionality of choosing a process from cpu_switch into
a much simpler function: cpu_switchto. Instead of having the locore
code walk the run queues, let the MI code choose the process we
want to run and only implement the context switching itself in MD
code.
- Let MD context switching run without worrying about spls or locks.
- Instead of having the idle loop implemented with special contexts
in MD code, implement one idle proc for each cpu. make the idle
loop MI with MD hooks.
- Change the proc lists from the old style vax queues to TAILQs.
- Change the sleep queue from vax queues to TAILQs. This makes
wakeup() go from O(n^2) to O(n)
there will be some MD fallout, but it will be fixed shortly.
There's also a few cleanups to be done after this.
deraadt@, kettenis@ ok
|
|
|
|
|
| |
leave macros behind for now to keep the commit small
ok art beck miod pedro
|
|
|
|
|
| |
for the list to become empty)
ok art
|
| |
|
|
|
|
| |
for the list to become empty)
|
| |
|
| |
|
|
|
|
| |
currently already happens in exit1(), okay art@
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
discussed with a few, ok tedu@
|
|
|
|
|
| |
previously, the child and parent would deadlock in the kernel
and be unable to exit. help with diagnosis from art@.
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok miod@
|
|
|
|
| |
no change in compiler assembly output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sends SIGVTALRM and SIGPROF to the process if they had. There is a big
problem with calling psignal from hardclock on MULTIPROCESSOR machines
though. It means we need to protect all signal state in the process
with a lock because hardclock doesn't obtain KERNEL_LOCK. Trying to
track down all the tentacles of this quickly becomes very messy. What
saves us at the moment is that SCHED_LOCK (which is used to protect
parts of the signal state, but not all) happens to be recursive and
forgives small and big errors. That's about to change.
So instead of trying to hunt down all the locking problems here, just
make hardclock not send signals. Instead hardclock schedules a timeout
that will send the signal later. There are many reasons why this works
just as good as the previous code, all explained in a comment written
in big, friendly letters in kern_clock.
miod@ ok noone else dared to ok this, but noone screamed in agony either.
|
|
|
|
|
|
|
| |
Also move the whole deadproc infrastructure to kern_exit, it's only used
there.
miod@ ok
|
| |
|
|
|
|
| |
ok art@ deraadt@
|