#
764fc8a0 |
| 15-Jul-2019 |
mpi <mpi@openbsd.org> |
Stop calling resched_proc() after changing the nice(3) value of a process.
Changing the scheduling priority of a process happens rarely, so it isn't strictly necessary to update the current priority
Stop calling resched_proc() after changing the nice(3) value of a process.
Changing the scheduling priority of a process happens rarely, so it isn't strictly necessary to update the current priority of every threads instantly.
Moreover resched_proc() isn't well suited to perform this action: it doesn't consider the state of each thread nor move them to another runqueue.
ok visa@
show more ...
|
#
55eab86c |
| 08-Jul-2019 |
mpi <mpi@openbsd.org> |
Untangle code setting the scheduling priority of a thread.
- `p_estcpu' and `p_usrpri' represent the priority and are now only set in a single function.
- Call resched_proc() after updating the pri
Untangle code setting the scheduling priority of a thread.
- `p_estcpu' and `p_usrpri' represent the priority and are now only set in a single function.
- Call resched_proc() after updating the priority and stop calling it from schedclock() since `spc_curpriority' should match curproc's priority.
- Rename updatepri() to match decay_cpu() and stop updating per-thread member.
- Merge two resched_proc() in one inside setrunnable().
Tweak and ok visa@
show more ...
|
#
5699f997 |
| 24-Jun-2019 |
visa <visa@openbsd.org> |
Guard uvm_map_protect() with kernel lock to prepare dosetrlimit() for unlocking.
OK semarie@ mpi@ deraadt@ anton@
|
#
edc99bcd |
| 21-Jun-2019 |
visa <visa@openbsd.org> |
Make resource limit access MP-safe. So far, the copy-on-write sharing of resource limit structs has been done between processes. By applying copy-on-write also between threads, threads can read rlimi
Make resource limit access MP-safe. So far, the copy-on-write sharing of resource limit structs has been done between processes. By applying copy-on-write also between threads, threads can read rlimits in a nearly lock-free manner.
Inspired by code in DragonFly BSD and FreeBSD.
OK mpi@, agreement from jmatthew@ and anton@
show more ...
|
#
3cb3b60b |
| 10-Jun-2019 |
visa <visa@openbsd.org> |
Avoid changing resource limits in rucheck() by introducing a new state variable that tracks when to send next SIGXCPU. This eases MP work and prevents accidental alteration of shared resource limit s
Avoid changing resource limits in rucheck() by introducing a new state variable that tracks when to send next SIGXCPU. This eases MP work and prevents accidental alteration of shared resource limit structs.
OK mpi@ semarie@
show more ...
|
#
1656bfe0 |
| 02-Jun-2019 |
visa <visa@openbsd.org> |
Move initialization of limit0 into a dedicated function. This new function is also a proper place for setting up the plimit pool.
While here, raise the IPL of the plimit pool to IPL_MPFLOOR, needed
Move initialization of limit0 into a dedicated function. This new function is also a proper place for setting up the plimit pool.
While here, raise the IPL of the plimit pool to IPL_MPFLOOR, needed in upcoming MP work.
OK claudio@
show more ...
|
#
17b25159 |
| 01-Jun-2019 |
mpi <mpi@openbsd.org> |
Revert to using the SCHED_LOCK() to protect time accounting.
It currently creates a lock ordering problem because SCHED_LOCK() is taken by hardclock(). That means the "priorities" of a thread shoul
Revert to using the SCHED_LOCK() to protect time accounting.
It currently creates a lock ordering problem because SCHED_LOCK() is taken by hardclock(). That means the "priorities" of a thread should be moved out of the SCHED_LOCK() first in order to make progress.
Reported-by: syzbot+8e4863b3dde88eb706dc@syzkaller.appspotmail.com via anton@ as well as by kettenis@
show more ...
|
#
4b91b74a |
| 31-May-2019 |
mpi <mpi@openbsd.org> |
Use a per-process mutex to protect time accounting instead of SCHED_LOCK().
Note that hardclock(9) still increments p_{u,s,i}ticks without holding a lock.
ok visa@, cheloha@
|
#
dd36ccd0 |
| 31-May-2019 |
visa <visa@openbsd.org> |
Rename struct plimit field p_refcnt to pl_refcnt to avoid confusion with the fields of struct proc. Make pl_refcnt unsigned for upcoming atomic updating.
OK deraadt@ guenther@
|
#
ec412da1 |
| 06-Jan-2019 |
visa <visa@openbsd.org> |
Fix unsafe use of ptsignal() in mi_switch().
ptsignal() has to be called with the kernel lock held. As ensuring the locking in mi_switch() is not easy, and deferring the signaling using the task API
Fix unsafe use of ptsignal() in mi_switch().
ptsignal() has to be called with the kernel lock held. As ensuring the locking in mi_switch() is not easy, and deferring the signaling using the task API is not possible because of lock order issues in mi_switch(), move the CPU time checking into a periodic timer where the kernel can be locked without issues.
With this change, each process has a dedicated resource check timer. The timer gets activated only when a CPU time limit is set. Because the checking is not done as frequently as before, some precision is lost.
Use of timers adapted from FreeBSD.
OK tedu@
Reported-by: syzbot+2f5d62256e3280634623@syzkaller.appspotmail.com
show more ...
|
#
3e676399 |
| 19-Feb-2018 |
mpi <mpi@openbsd.org> |
Remove almost unused `flags' argument of suser().
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field.
No objection from mill
Remove almost unused `flags' argument of suser().
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
show more ...
|
#
1378bae2 |
| 15-Sep-2016 |
dlg <dlg@openbsd.org> |
all pools have their ipl set via pool_setipl, so fold it into pool_init.
the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the
all pools have their ipl set via pool_setipl, so fold it into pool_init.
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);
show more ...
|
#
86832774 |
| 25-Aug-2016 |
dlg <dlg@openbsd.org> |
pool_setipl
ok kettenis@
|
#
52dd740a |
| 05-Dec-2015 |
tedu <tedu@openbsd.org> |
remove stale lint annotations
|
#
7180d9ea |
| 09-Feb-2015 |
miod <miod@openbsd.org> |
Stop using USRSTACK as the edge of the stack, but rather use the vmspace vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in.
This should have no effect on the existing behavi
Stop using USRSTACK as the edge of the stack, but rather use the vmspace vm_minsaddr or vm_maxsaddr, depending upon the direction the stack goes in.
This should have no effect on the existing behaviourrr.
ok kettenis@ deraadt@
show more ...
|
#
fbab5b6c |
| 19-Dec-2014 |
tedu <tedu@openbsd.org> |
start retiring the nointr allocator. specify PR_WAITOK as a flag as a marker for which pools are not interrupt safe. ok dlg
|
#
2955d5bc |
| 10-Dec-2014 |
tedu <tedu@openbsd.org> |
convert bcopy to memcpy. ok millert
|
#
1e8cdc2e |
| 16-Nov-2014 |
deraadt <deraadt@openbsd.org> |
Replace a plethora of historical protection options with just PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove
Replace a plethora of historical protection options with just PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
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 ...
|
#
7f86807e |
| 24-Jan-2014 |
guenther <guenther@openbsd.org> |
exit1() needs to do a final aggregation of the thread's [us]ticks and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage().
problem pointed out by tedu@ ok
exit1() needs to do a final aggregation of the thread's [us]ticks and runtime to the process totals. Also, add ktracing of struct rusage in wait4() and getrusage().
problem pointed out by tedu@ ok deraadt@
show more ...
|
#
91ba896d |
| 21-Jan-2014 |
tedu <tedu@openbsd.org> |
bzero -> memset
|
#
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 ...
|
#
14988649 |
| 25-Oct-2013 |
guenther <guenther@openbsd.org> |
Move the declarations for dogetrusage(), itimerround(), and dowait4() to sys/*.h headers so that the compat/linux code can use them. Change dowait4() to not copyout() the status value, but rather lea
Move the declarations for dogetrusage(), itimerround(), and dowait4() to sys/*.h headers so that the compat/linux code can use them. Change dowait4() to not copyout() the status value, but rather leave that for its caller, as compat/linux has to translate it, with the side benefit of simplifying the native code.
Originally written months ago as part of the time_t work; long memory, prodding, and ok from pirofti@
show more ...
|
#
064563b4 |
| 14-Sep-2013 |
guenther <guenther@openbsd.org> |
Eliminate the unused retval argument from dogetrusage()
|
#
1759f769 |
| 14-Sep-2013 |
guenther <guenther@openbsd.org> |
Snapshots for all archs have been built, so remove the T32 code
|