History log of /openbsd-src/sys/kern/kern_fork.c (Results 101 – 125 of 268)
Revision Date Author Comments
# 644b4788 04-Jul-2014 guenther <guenther@openbsd.org>

Track whether a process is a zombie or not yet fully built via flags
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's
thread data. This eliminates the need for the thread-leve

Track whether a process is a zombie or not yet fully built via flags
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's
thread data. This eliminates the need for the thread-level SDEAD state.

Change kvm_getprocs() (both the sysctl() and kvm backends) to report the
"most active" scheduler state for the process's threads.

tweaks kettenis@
feedback and ok matthew@

show more ...


# 924be113 15-May-2014 guenther <guenther@openbsd.org>

Move from struct proc to process the reference-count-holding pointers
to the process's vmspace and filedescs. struct proc continues to
keep copies of the pointers, copying them on fork, clearing the

Move from struct proc to process the reference-count-holding pointers
to the process's vmspace and filedescs. struct proc continues to
keep copies of the pointers, copying them on fork, clearing them
on exit, and (for vmspace) refreshing on exec.
Also, make uvm_swapout_threads() thread aware, eliminating p_swtime
in kernel.

particular testing by ajacoutot@ and sebastia@

show more ...


# 512dfaa6 06-May-2014 mpi <mpi@openbsd.org>

Include <sys/vmmeter.h> directly instead of relying on it being
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private
function.

The preferred way to get memory stats is through the VM_UVM

Include <sys/vmmeter.h> directly instead of relying on it being
pulled by <uvm/uvm_extern.h> and turn uvm_total() into a private
function.

The preferred way to get memory stats is through the VM_UVMEXP
sysctl(3) since VM_METER is just a wrapper on top of it. In the
kernel, use `uvmexp' directly instead of uvm_total().

This change does not remove <sys/vmmeter.h> from <uvm/uvm_extern.h>
to give some more time to port maintainers to fix their ports.

ok guenther@ as part of a larger diff.

show more ...


# ed557a36 04-May-2014 guenther <guenther@openbsd.org>

Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,
and FORK_SYSTEM as a flag to set them. This eliminates needing to
peek into other processes threads in various places. Inspired

Add PS_SYSTEM, the process-level mirror of the thread-level P_SYSTEM,
and FORK_SYSTEM as a flag to set them. This eliminates needing to
peek into other processes threads in various places. Inspired by NetBSD

ok miod@ matthew@

show more ...


# 0411e090 03-May-2014 guenther <guenther@openbsd.org>

Move the u-area allocation and pmap-magic logic to its own function
uvm_uarea_alloc()

function name from NetBSD; arm testing by miod@


# a9ddc286 18-Apr-2014 guenther <guenther@openbsd.org>

Have each thread keeps its own (counted!) reference to the process's ucreds
to avoid possible use-after-free references when swapping ids in threaded
processes. "Do I have the right creds?" checks a

Have each thread keeps its own (counted!) reference to the process's ucreds
to avoid possible use-after-free references when swapping ids in threaded
processes. "Do I have the right creds?" checks are always made with the
threads creds.

Inspired by FreeBSD and NetBSD
"right time" deraadt@

show more ...


# d559b8cb 30-Mar-2014 guenther <guenther@openbsd.org>

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetB

Eliminates struct pcred by moving the real and saved ugids into
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@

show more ...


# 4bb7a4f6 28-Mar-2014 mpi <mpi@openbsd.org>

Reduce uvm include madness. Use <uvm/uvm_extern.h> instead of
<uvm/uvm.h> if possible and remove double inclusions.

ok beck@, mlarkin@, deraadt@


# 8f76f5ad 26-Mar-2014 guenther <guenther@openbsd.org>

Move p_emul and p_sigcode from proc to process.
Tweak the handling of ktrace EMUL when changing ktracing: only
generate one per process (not one per thread) and pass the correct
proc pointer down to

Move p_emul and p_sigcode from proc to process.
Tweak the handling of ktrace EMUL when changing ktracing: only
generate one per process (not one per thread) and pass the correct
proc pointer down to the VFS layer. Permit generating of NAMI and
CSW records inside ktrace(2) itself.

ok deraadt@ millert@

show more ...


# 533be81a 22-Mar-2014 guenther <guenther@openbsd.org>

Move p_sigacts from struct proc to struct process.

testing help mpi@


# 34b8a7e2 12-Feb-2014 guenther <guenther@openbsd.org>

Eliminate the exit sig handling, which was only invokable via the
Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@
confirms Opera runs in compat without this, so out it goes; one

Eliminate the exit sig handling, which was only invokable via the
Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@
confirms Opera runs in compat without this, so out it goes; one less hair
to choke on in kern_exit.c

ok tedu@ pirofti@

show more ...


# ffd93db0 10-Feb-2014 guenther <guenther@openbsd.org>

arc4random_uniform() returns a value strictly less than its argument; fix
arithmetic so that PID_MAX can be reached.

ok otto@ zhuk@ miod@


# 712e2ef1 20-Jan-2014 guenther <guenther@openbsd.org>

Threads can't be zombies, only processes, so change zombproc to zombprocess,
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread
flags to process flags. Add allprocess list

Threads can't be zombies, only processes, so change zombproc to zombprocess,
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread
flags to process flags. Add allprocess list for the code that just wants
to see processes.

ok tedu@

show more ...


# 4ab8ed70 20-Jan-2014 guenther <guenther@openbsd.org>

Move p_textvp from struct proc to struct process so that the exit code
can be further simplified.

ok kettenis@


# a554f8d9 08-Oct-2013 guenther <guenther@openbsd.org>

Fix delivery of SIGPROF and SIGVTALRM to threaded processes by having
hardclock() set a flag on the running thread and force AST processing,
and then have the thread signal itself from userret().

id

Fix delivery of SIGPROF and SIGVTALRM to threaded processes by having
hardclock() set a flag on the running thread and force AST processing,
and then have the thread signal itself from userret().

idea and flag names from FreeBSD
ok jsing@

show more ...


# 97f309f1 14-Aug-2013 guenther <guenther@openbsd.org>

The last user of the old __tfork() was updated to the current one,
so COMPAT_O51 can go. The complete ABI role means COMPAT_O53 can
be removed as well.

ok jsing@ tedu@


# 06494c7c 11-Jun-2013 tedu <tedu@openbsd.org>

convert some easy bcopy to memcpy and clean up fdexpand a bit.
ok kettenis


# a48ed3dd 06-Jun-2013 haesbaert <haesbaert@openbsd.org>

Prevent idle thread from being stolen on startup.

There is a race condition which might trigger a case where two cpus try
to run the same idle thread.

The problem arises when one cpu steals the idl

Prevent idle thread from being stolen on startup.

There is a race condition which might trigger a case where two cpus try
to run the same idle thread.

The problem arises when one cpu steals the idle proc of another cpu and
this other cpu ends up running the idle thread via spc->spc_idleproc,
resulting in two cpus trying to cpu_switchto(idleX).

On startup, idle procs are scaterred around different runqueues, the
decision for scheduling is:

1 look at my runqueue.
2 if empty, look at other dudes runqueue.
3 if empty, select idle proc via spc->spc_idleproc.

The problem is that cpu0's idle0 might be running on cpu1 due to step 1
or 2 and cpu0 hits step 3.

So cpu0 will select idle0, while cpu1 is in fact running it already.

The solution is to never place idle on a runqueue, therefore being
only selectable through spc->spc_idleproc.

This race can be more easily triggered on a HT cpu on virtualized
environments, where the guest more often than not doesn't have the cpu
for itself, so timing gets shuffled.

ok tedu@ guenther@
go ahead after t2k13 deraadt@

show more ...


# 718a8735 05-Jun-2013 tedu <tedu@openbsd.org>

factor out pid allocation to functions. add a small cache of recently
exited pids that won't get recycled.
ok deraadt


# f99e27fe 03-Jun-2013 guenther <guenther@openbsd.org>

When creating a thread, don't add it to the process's thread list
until it's fully built, so that it can't get a signal from
realitexpire(), as seen by sthen@ and espie@ in ports builds.

Exact bits

When creating a thread, don't add it to the process's thread list
until it's fully built, so that it can't get a signal from
realitexpire(), as seen by sthen@ and espie@ in ports builds.

Exact bits moved down worked out with tedu@, ok deraadt@

show more ...


# 08be1c18 03-Jun-2013 guenther <guenther@openbsd.org>

Convert some internal APIs to use timespecs instead of timevals

ok matthew@ deraadt@


# 78aa712e 01-Jun-2013 tedu <tedu@openbsd.org>

As found by kurt, there's a twisty race between exit1 and fork1
with threaded processes. Fix this by checking for an attempt to go
single threaded in fork1 and account for the new thread as well.
ok

As found by kurt, there's a twisty race between exit1 and fork1
with threaded processes. Fix this by checking for an attempt to go
single threaded in fork1 and account for the new thread as well.
ok espie guenther kurt

show more ...


# 7e499281 06-Apr-2013 tedu <tedu@openbsd.org>

rthreads are always enabled. remove the sysctl.
ok deraadt guenther kettenis matthew


# 0af1a64d 14-Mar-2013 tedu <tedu@openbsd.org>

the 5.1 era tfork syscall claws its way out of the grave. we failed to
fully deprecate it (notably the go port was still using it as of 5.3)
so to give users a little more time to update, __tfork51 l

the 5.1 era tfork syscall claws its way out of the grave. we failed to
fully deprecate it (notably the go port was still using it as of 5.3)
so to give users a little more time to update, __tfork51 lives again.
okish deraadt guenther

show more ...


# 590b2eb9 02-Mar-2013 guenther <guenther@openbsd.org>

No longer need the 5.1 version of the __tfork syscall

ok deraadt@


1234567891011