History log of /openbsd-src/sys/kern/kern_fork.c (Results 126 – 150 of 268)
Revision Date Author Comments
# 6293fd65 19-Nov-2012 guenther <guenther@openbsd.org>

If uvm_km_kmemalloc_pla() fails when just creating a thread (and not a
process), then don't decrement the total and per-user counts of processes.

ok deraadt@ miod@


# 18914fdf 02-Aug-2012 guenther <guenther@openbsd.org>

Apply profiling to all threads instead of just the thread that called
profil() by moving P_PROFIL from proc->p_flag to process->ps_flags with
matching adjustment in fork1() and exit1()

ok matthew@


# 16b62b6a 21-Jun-2012 guenther <guenther@openbsd.org>

__tfork() needs to set the stack address of the new thread in the kernel,
so that it can't get a signal while still running on the parent thread's
stack. Also, pass in sizeof(struct __tfork) to prov

__tfork() needs to set the stack address of the new thread in the kernel,
so that it can't get a signal while still running on the parent thread's
stack. Also, pass in sizeof(struct __tfork) to provide forward compat
when more members are added. This is an ABI change, so switch syscall
numbers and bump lib majors this time.

ok deraadt@ matthew@

show more ...


# 0303b083 10-May-2012 guenther <guenther@openbsd.org>

Only set a process's start time when starting the main thread. There's
also no need to protect that and the setting of the AFORK accounting flag
with the scheduler lock.

ok mikeb@


# 4ec19540 13-Apr-2012 kettenis <kettenis@openbsd.org>

First stab at making ptrace(2) usable for debugging multi-threaded programs.
It implements a full-stop model where all threads are stopped before handing
over control to the debugger. Events are rep

First stab at making ptrace(2) usable for debugging multi-threaded programs.
It implements a full-stop model where all threads are stopped before handing
over control to the debugger. Events are reported as before through wait(2);
you will have to call ptrace(PT_GET_PROCESS_STATE, ...) to find out which
thread hit the event. Since this changes the size of struct ptrace_state,
you will have to recompile gdb.

ok guenther@

show more ...


# 78f78c26 12-Apr-2012 deraadt <deraadt@openbsd.org>

remove rfork(); ok guenther miod


# 0839b846 12-Apr-2012 mikeb <mikeb@openbsd.org>

move accounting flags to struct process; idea and ok guenther


# e6fd2ff8 10-Apr-2012 guenther <guenther@openbsd.org>

Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads. New sysctl()s KERN_NTHREADS and
KERN_MAXTHREAD count and limit threads. The nprocs an

Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads. New sysctl()s KERN_NTHREADS and
KERN_MAXTHREAD count and limit threads. The nprocs and maxproc kernel
variables are replaced by nprocess, maxprocess, nthreads, and maxthread.

ok tedu@ mikeb@

show more ...


# 8f15e6a4 23-Mar-2012 guenther <guenther@openbsd.org>

Make rusage totals, itimers, and profile settings per-process instead
of per-rthread. Handling of per-thread tick and runtime counters
inspired by how FreeBSD does it.

ok kettenis@


# 6b6f3ef9 20-Feb-2012 guenther <guenther@openbsd.org>

First steps for making ptrace work with rthreads:
- move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and
p_ptstat member from struct proc to struct process
- sort the PT_* requests i

First steps for making ptrace work with rthreads:
- move the P_TRACED and P_INEXEC flags, and p_oppid, p_ptmask, and
p_ptstat member from struct proc to struct process
- sort the PT_* requests into those that take a PID vs those that
can also take a TID
- stub in PT_GET_THREAD_FIRST and PT_GET_THREAD_NEXT

ok kettenis@

show more ...


# a2e04e14 14-Dec-2011 guenther <guenther@openbsd.org>

Handle rthreads consistently in ktrace by moving the flags and vnode into
struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials
used to open the file in sys_ktrace() and use them

Handle rthreads consistently in ktrace by moving the flags and vnode into
struct process; KTRFAC_ACTIVE becomes P_INKTR. Also, save the credentials
used to open the file in sys_ktrace() and use them for all writes to the
vnode.

much feedback and ok jsing@

show more ...


# a9b1ac21 22-Nov-2011 joshe <joshe@openbsd.org>

Move struct proc's sigaltstack struct from the zeroed area into the
copied area, and initialize it properly in the FORK_THREAD case.

This restores the behavior of a forked process inheriting its par

Move struct proc's sigaltstack struct from the zeroed area into the
copied area, and initialize it properly in the FORK_THREAD case.

This restores the behavior of a forked process inheriting its parent's
signal stack.

ok guenther@

show more ...


# e8200582 09-Nov-2011 guenther <guenther@openbsd.org>

Change fork1() and kthread_create() to match the rest of the tree
and use curp vs p instead of p1 vs p2. Add curpr and pr variables
for the respective struct processes. Make sigactsshare() return
t

Change fork1() and kthread_create() to match the rest of the tree
and use curp vs p instead of p1 vs p2. Add curpr and pr variables
for the respective struct processes. Make sigactsshare() return
the shared sigacts intead of taking the struct proc to update.

ok deraadt@

show more ...


# eee814dc 05-Nov-2011 guenther <guenther@openbsd.org>

I had moved earlier the adding of processes to the pgrp and children lists
during the big rework at c2k10, but it's too early as signals can be posted
before the process is fully built. Move those l

I had moved earlier the adding of processes to the pgrp and children lists
during the big rework at c2k10, but it's too early as signals can be posted
before the process is fully built. Move those list adds back down to the
late stage they were before.

Problem seen on sebastia@'s sparc.
ok deraadt@ miod@

show more ...


# 6bb85547 15-Oct-2011 guenther <guenther@openbsd.org>

"TLS-lite": add kernel support for a per-thread userspace pointer,
for pointing to the thread-control-block. Support for mapping this
to the correct hardware register can be added as it's finished;

"TLS-lite": add kernel support for a per-thread userspace pointer,
for pointing to the thread-control-block. Support for mapping this
to the correct hardware register can be added as it's finished;
start with support for amd64, sparc, and sparc64. Includes syscalls
for getting and setting it (for a portable __errno implementation) as
well as creating a new thread with an initial value for it.

discussed with miod@, kettenis@, deraadt@; committing to get the syscalls
in with the impending libc bump and do further refinements in tree

show more ...


# 9d9e0950 07-Jul-2011 guenther <guenther@openbsd.org>

Functions used in files other than where they are defined should be
declared in .h files, not in each .c. Apply that rule to endtsleep(),
scheduler_start(), updatepri(), and realitexpire()

ok deraa

Functions used in files other than where they are defined should be
declared in .h files, not in each .c. Apply that rule to endtsleep(),
scheduler_start(), updatepri(), and realitexpire()

ok deraadt@ tedu@

show more ...


# 971e1bb6 06-Jul-2011 art <art@openbsd.org>

Clean up after P_BIGLOCK removal.
KERNEL_PROC_LOCK -> KERNEL_LOCK
KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK

oga@ ok


# e54c1b3d 06-Jun-2011 deraadt <deraadt@openbsd.org>

push kernel malloc(9) and kernel stacks into non-dma memory, since that
appears to be safe now. If not, we'll know soon where the bugs lie, so
that we can fix them. This diff has been in snapshots

push kernel malloc(9) and kernel stacks into non-dma memory, since that
appears to be safe now. If not, we'll know soon where the bugs lie, so
that we can fix them. This diff has been in snapshots for many months.
ok oga miod

show more ...


# c0ce47d9 03-Apr-2011 guenther <guenther@openbsd.org>

Move PPWAIT flag from struct proc to process, so that rthreads in
a vforked child behave correctly. Have the parent in a vfork()
wait on a (different) flag in *its* process instead of the child
to p

Move PPWAIT flag from struct proc to process, so that rthreads in
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@

show more ...


# bfb8af8f 02-Apr-2011 guenther <guenther@openbsd.org>

Move P_SUGID and P_SUGIDEXEC from struct proc to struct process, so
that you can't evade the checks by doing the dirty work in an rthread

ok blambert@, deraadt@


# f065ab1d 31-Oct-2010 guenther <guenther@openbsd.org>

The return of rfork(RFTHREAD) must be consistent with getthrid().
Fixes rthread breakage observed by Vladimir Kirillov.


# 207e4b38 26-Jul-2010 guenther <guenther@openbsd.org>

Correct the links between threads, processes, pgrps, and sessions,
so that the process-level stuff is to/from struct process and not
struct proc. This fixes a bunch of problem cases in rthreads.
Bas

Correct the links between threads, processes, pgrps, and sessions,
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

show more ...


# 5ee6054f 23-Jul-2010 miod <miod@openbsd.org>

Make sure the u area of new processes is zero-filled; this got lost in
1.119.


# 7c5b0101 19-Jul-2010 guenther <guenther@openbsd.org>

Rollback the allproclk and fileheadlk addition. When grabbing an
rwlock, the thread will release biglock if it sleeps, means that
atomicity from before the rw_enter() to after it is not guaranteed.

Rollback the allproclk and fileheadlk addition. When grabbing an
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@

show more ...


# 42096da3 02-Jul-2010 art <art@openbsd.org>

add an align argument to uvm_km_kmemalloc_pla.

Use uvm_km_kmemalloc_pla with the dma constraint to allocate kernel stacks.

Yes, that means DMA is possible to kernel stacks, but only until we've fix

add an align argument to uvm_km_kmemalloc_pla.

Use uvm_km_kmemalloc_pla with the dma constraint to allocate kernel stacks.

Yes, that means DMA is possible to kernel stacks, but only until we've fixed
all the scary drivers.

deraadt@ ok

show more ...


1234567891011