| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.
|
|
|
|
|
|
|
| |
Currently all iterations are done under KERNEL_LOCK() and therefor use
the *_LOCKED() variant.
From and ok claudio@
|
|
|
|
|
|
|
|
|
|
| |
enough that this pool uses the single page allocator for which PR_WAITOK
is a no-op. However it presence suggests that pool_put(9) may sleep.
The single page allocator will never actually do that.
This makes it obvious that refreshcreds() will not sleep.
ok deraadt@, visa@
|
|
|
|
| |
ok claudio@
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
It centralizes IO signal privilege checking and makes possible to revoke
a registration when the target process or process group is deleted.
Adapted from FreeBSD.
OK kettenis@ mpi@ guenther@
|
|
|
|
|
|
|
|
|
|
|
| |
to make crfree() and crhold() MP-safe. Make crhold() a proper function.
Put the definition into file kern_prot.c to constrain the need of the
<sys/atomic.h> header.
While there, adjust the IPL of ucred_pool to avoid lock order problems
with the kernel lock (pointed out by kettenis@).
OK mpi@
|
|
|
|
|
|
|
|
| |
protection cannot block the final SIGABRT.
While here apply the same logic to ddb(4)'s kill command.
From semarie@, ok deraadt@
|
|
|
|
|
|
|
| |
Caller must call uid_release() after making whatever change they needed
on the result of uid_find().
Adapted from guenther@'s proctree diff, ok dlg@, visa@
|
|
|
|
|
|
|
| |
This code shuffling will ease the introduction of the proctree lock
in sys_setsid() and sys_setpgid().
Extracted from a larger diff from guenther@, ok visa@
|
|
|
|
|
|
| |
Part of the larger 'proctreelk' diff from guenther@
No functional change, ok benno@, tedu@
|
|
|
|
| |
ok millert@ krw@
|
|
|
|
|
|
|
| |
extend ddb(4) "ps /o" output to print which CPU is currently holding the
KERNEL_LOCK().
Tested by dhill@, ok visa@
|
|
|
|
|
|
|
|
| |
Send an uncatchable SIGABRT to the process specified by the pid
argument. Useful in case of CPU exhaustion to kill the DoSing
process and generate a core for later inspection.
ok phessler@, visa@, kettenis@, miod@
|
| |
|
|
|
|
|
|
| |
While here fix the formating of /w /o and /a.
ok guenther@
|
|
|
|
|
|
|
|
| |
in ddb(4)'s default 'ps' view.
This allow to use 'tr /p' easily now that it requires a TID.
With inputs from guenther@
|
|
|
|
|
|
| |
While here document prfind(9.
with and ok guenther@
|
|
|
|
|
|
| |
struct proc to struct process.
ok deraadt@ kettenis@
|
|
|
|
|
|
| |
initial thread
ok jsing@ kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
|
|
|
|
| |
the user and parent process are recorded. Later, this info may be tested
and used to bypass authorization requirements.
ie, doas won't ask for your password again.
Great idea from henning.
ok deraadt guenther henning
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
|
|
|
|
| |
kill(2) is supposed to find zombie processes, this probably got broken
when the process reaper was introduced. As a temporary(tm) workaround,
walk the list of zombie processes if we can't find the target pid in the
main process list.
Problem with zsh initially reported by Geoff Wozniak on misc@, analysis
done by naddy@. ok kettenis@ tedu@
|
| |
|
|
|
|
| |
ok deraadt@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
| |
marker for which pools are not interrupt safe. ok dlg
|
| |
|
|
|
|
| |
ok doug tedu
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
|
|
| |
them via sysctl(KERN_PROC). In struct kinfo_proc the per-process
flags move to p_psflags, leaving the per-thread flags in p_flags.
Flag descriptions in ps(1) updated to be less obtuse.
discussed with matthew@ some time ago; ok jca@, manpage bits ok jmc@
|
|
|
|
|
|
|
| |
for ddb to show both. So or them together in the ps overview and
list them explicitly for the specific thread. Also sync the ddb
bit names with the define names.
OK miod@
|
|
|
|
| |
tested on vax (gcc3) ok miod@
|
|
|
|
|
|
| |
in MI code; gcc 2.95 does not accept such annotation for function pointer
declarations, only function prototypes.
To be uncommented once gcc 2.95 bites the dust.
|
|
|
|
|
|
| |
function pointer arguments which are {used as,} wrappers around the kernel
printf function.
No functional change.
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
| |
into struct process.
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@
|
|
|
|
|
|
|
| |
grabbing allproclk in proc_zap(); skip such processes in sysctl(KERN_PROC*)
and handle the NULL pointer in ddb's ps.
ok tedu@
|
|
|
|
|
| |
list walkers in sysctl that can block. As a reward, no more vslock.
With some feedback from art, guenther, phessler. ok guenther.
|
|
|
|
|
|
|
|
| |
of a direct ancestor, closing a localhost DoS. As an exception,
do permit ptrace() of pid 1 and have inferiors() stop climbing if
it hits that.
ok tedu@ hpux_compat suggestion from miod@
|