#
29d5b944 |
| 10-Nov-2024 |
jsg <jsg@openbsd.org> |
no need to include both uvm.h and uvm_extern.h
|
#
c9003b50 |
| 15-Oct-2024 |
claudio <claudio@openbsd.org> |
Fix runtime calculation. Assiging ts to spc_runtime does not work if ts is modified. OK tb@ jca@
|
#
7b3f8d1d |
| 08-Oct-2024 |
claudio <claudio@openbsd.org> |
Move common code to update the proc runtime into tuagg_add_runtime().
OK mpi@ kn@
|
#
79e5ab1f |
| 03-Oct-2024 |
claudio <claudio@openbsd.org> |
In rucheck() sum up the tusage from all threads to get the real current runtime of the process. Also this no longer needs the SCHED_LOCK(). OK mpi@
|
#
82bcd5c4 |
| 01-Oct-2024 |
claudio <claudio@openbsd.org> |
Make it more obvious which ruadd argument is the source and which one is the destination by adding const to the source pointer.
OK tb@
|
#
1b92846d |
| 20-Aug-2024 |
mvs <mvs@openbsd.org> |
Unlock KERN_MAXFILES.
`maxfiles' is atomically accessed integer which is lockless and read-only accessed in file descriptors layer.
lim_startup() called during kernel bootstrap, no need to atomic_l
Unlock KERN_MAXFILES.
`maxfiles' is atomically accessed integer which is lockless and read-only accessed in file descriptors layer.
lim_startup() called during kernel bootstrap, no need to atomic_load_int() within.
ok mpi
show more ...
|
#
2d79d4b5 |
| 20-Aug-2024 |
mvs <mvs@openbsd.org> |
Unlock KERN_MAXPROC and KERN_MAXTHREAD from `kern_vars'. Both `maxprocess' and `maxthread' are atomically accessed integers.
ok mpi
|
#
c6adfb2b |
| 09-Jul-2024 |
claudio <claudio@openbsd.org> |
Remove splassert() for now since IPL_STATCLOCK is MD and not all archs have it. Noticed by bluhm@ on octeon
|
#
241d6723 |
| 08-Jul-2024 |
claudio <claudio@openbsd.org> |
Rework per proc and per process time usage accounting
For procs (threads) the accounting happens now lockless by curproc using a generation counter. Callers need to use tu_enter() and tu_leave() for
Rework per proc and per process time usage accounting
For procs (threads) the accounting happens now lockless by curproc using a generation counter. Callers need to use tu_enter() and tu_leave() for this. To read the proc p_tu struct tuagg_get_proc() should be used. It ensures that the values read is consistent.
For processes only the time of exited threads is accumulated in ps_tu and to get the proper process time usage tuagg_get_process() needs to be called. tuagg_get_process() will sum up all procs p_tu plus the ps_tu.
This removes another SCHED_LOCK() dependency. Adjust the code in exit1() and exit2() to correctly account for the full run time. For this adjust sched_exit() to do the runtime accounting like it is done in mi_switch().
OK jca@ dlg@
show more ...
|
#
a09e9584 |
| 03-Jun-2024 |
claudio <claudio@openbsd.org> |
Remove the now unsued s argument to SCHED_LOCK and SCHED_UNLOCK.
The SPL level is not tacked by the mutex and we no longer need to track this in the callers. OK miod@ mlarkin@ tb@ jca@
|
#
f5a6fea6 |
| 22-May-2024 |
claudio <claudio@openbsd.org> |
Just grab the SCHED_LOCK() once in donice() before walking the ps_threads list. setpriority() is trivial and probably faster than releasing and relocking SCHED_LOCK(). OK jca@
|
#
223cf45d |
| 20-May-2024 |
claudio <claudio@openbsd.org> |
Rework interaction between sleep API and exit1() and start unlocking ps_threads
This diff adjusts how single_thread_set() accounts the threads by using ps_threadcnt as initial value and counting all
Rework interaction between sleep API and exit1() and start unlocking ps_threads
This diff adjusts how single_thread_set() accounts the threads by using ps_threadcnt as initial value and counting all threads out that are already parked. In single_thread_check call exit1() before decreasing ps_singlecount this is now done in exit1().
exit1() and thread_fork() ensure that ps_threadcnt is updated with the pr->ps_mtx held and in exit1() also account for exiting threads since exit1() can sleep.
OK mpi@
show more ...
|
#
907c54a8 |
| 17-Apr-2024 |
claudio <claudio@openbsd.org> |
dogetrusage() must be called with the KERNEL_LOCK held for now. OK mpi@
|
#
ed07db5b |
| 13-Sep-2023 |
claudio <claudio@openbsd.org> |
Revert commitid: yfAefyNWibUyjkU2, ESyyH5EKxtrXGkS6 and itscfpFvJLOj8mHB;
The change to the single thread API results in crashes inside exit1() as found by Syzkaller. There seems to be a race in the
Revert commitid: yfAefyNWibUyjkU2, ESyyH5EKxtrXGkS6 and itscfpFvJLOj8mHB;
The change to the single thread API results in crashes inside exit1() as found by Syzkaller. There seems to be a race in the exit codepath. What exactly fails is not really clear therefor revert for now.
This should fix the following Syzkaller reports: Reported-by: syzbot+38efb425eada701ca8bb@syzkaller.appspotmail.com Reported-by: syzbot+ecc0e8628b3db39b5b17@syzkaller.appspotmail.com and maybe more.
Reverted commits: ---------------------------- Protect ps_single, ps_singlecnt and ps_threadcnt by the process mutex.
The single thread API needs to lock the process to enter single thread mode and does not need to stop the scheduler.
This code changes ps_singlecount from a count down to zero to ps_singlecnt which counts up until equal to ps_threadcnt (in which case all threads are properly asleep).
Tested by phessler@, OK mpi@ cheloha@ ---------------------------- Change how ps_threads and p_thr_link are locked away from using SCHED_LOCK.
The per process thread list can be traversed (read) by holding either the KERNEL_LOCK or the per process ps_mtx (instead of SCHED_LOCK). Abusing the SCHED_LOCK for this makes it impossible to split up the scheduler lock into something more fine grained.
Tested by phessler@, ok mpi@ ---------------------------- Fix SCHED_LOCK() leak in single_thread_set()
In the (q->p_flag & P_WEXIT) branch is a continue that did not release the SCHED_LOCK. Refactor the code a bit to simplify the places SCHED_LOCK is grabbed and released.
Reported-by: syzbot+ea26d351acfad3bb3f15@syzkaller.appspotmail.com OK kettenis@
show more ...
|
#
13095e6d |
| 08-Sep-2023 |
claudio <claudio@openbsd.org> |
Change how ps_threads and p_thr_link are locked away from using SCHED_LOCK.
The per process thread list can be traversed (read) by holding either the KERNEL_LOCK or the per process ps_mtx (instead o
Change how ps_threads and p_thr_link are locked away from using SCHED_LOCK.
The per process thread list can be traversed (read) by holding either the KERNEL_LOCK or the per process ps_mtx (instead of SCHED_LOCK). Abusing the SCHED_LOCK for this makes it impossible to split up the scheduler lock into something more fine grained.
Tested by phessler@, ok mpi@
show more ...
|
#
94c38e45 |
| 29-Aug-2023 |
claudio <claudio@openbsd.org> |
Remove p_rtime from struct proc and replace it by passing the timespec as argument to the tuagg_locked function.
- Remove incorrect use of p_rtime in other parts of the tree. p_rtime was almost alwa
Remove p_rtime from struct proc and replace it by passing the timespec as argument to the tuagg_locked function.
- Remove incorrect use of p_rtime in other parts of the tree. p_rtime was almost always 0 so including it in any sum did not alter the result. - In main() the update of time can be further simplified since at that time only the primary cpu is running. - Add missing nanouptime() call in cpu_hatch() for hppa - Rename tuagg_unlocked to tuagg_locked like it is done in the rest of the tree.
OK cheloha@ dlg@
show more ...
|
#
9bcfcad5 |
| 04-Feb-2023 |
cheloha <cheloha@openbsd.org> |
kernel: stathz is always non-zero after cpu_initclocks()
Now that the clockintr switch is complete, cpu_initclocks() always initializes stathz to a non-zero value. We don't call statclock() from ha
kernel: stathz is always non-zero after cpu_initclocks()
Now that the clockintr switch is complete, cpu_initclocks() always initializes stathz to a non-zero value. We don't call statclock() from hardclock(9) anymore and, more broadly, we don't need to test whether stathz is non-zero before using it.
With input from kettenis@.
Link: https://marc.info/?l=openbsd-tech&m=167434223309668&w=2
ok kettenis@ miod@
show more ...
|
#
4c8ae43b |
| 17-Nov-2022 |
deraadt <deraadt@openbsd.org> |
stack growth from setrlimit was never updated to set UVM_ET_STACK on the entries, so the check-sp-at-system-call check failed. Quite strange it took this long to find this. ok kettenis
|
#
8c7187e8 |
| 07-Oct-2022 |
deraadt <deraadt@openbsd.org> |
Add mimmutable(2) system call which locks the permissions (PROT_*) of memory mappings so they cannot be changed by a later mmap(), mprotect(), or munmap(), which will error with EPERM instead. ok ket
Add mimmutable(2) system call which locks the permissions (PROT_*) of memory mappings so they cannot be changed by a later mmap(), mprotect(), or munmap(), which will error with EPERM instead. ok kettenis
show more ...
|
#
a04785a6 |
| 28-May-2022 |
deraadt <deraadt@openbsd.org> |
oops, wrong value in previous commit
|
#
8223b9b7 |
| 28-May-2022 |
deraadt <deraadt@openbsd.org> |
64K of locked memory should be enough for anyone (until we hear a good reason why) discussed with many, ok millert
|
#
9a63f94c |
| 18-Mar-2022 |
visa <visa@openbsd.org> |
Use the refcnt API with struct plimit.
OK bluhm@ dlg@
|
#
193f316c |
| 08-Feb-2021 |
mpi <mpi@openbsd.org> |
Revert the convertion of per-process thread into a SMR_TAILQ.
We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change.
|
#
b21c774f |
| 07-Dec-2020 |
mpi <mpi@openbsd.org> |
Convert the per-process thread list into a SMR_TAILQ.
Currently all iterations are done under KERNEL_LOCK() and therefor use the *_LOCKED() variant.
From and ok claudio@
|
#
d52ff6db |
| 25-Sep-2020 |
cheloha <cheloha@openbsd.org> |
setpriority(2): don't treat booleans as scalars
The variable "found" in sys_setpriority() is used as a boolean. We should set it to 1 to indicate that we found the object we were looking for instead
setpriority(2): don't treat booleans as scalars
The variable "found" in sys_setpriority() is used as a boolean. We should set it to 1 to indicate that we found the object we were looking for instead of incrementing it.
deraadt@ notes that the current code is not buggy, because OpenBSD cannot support anywhere near 2^32 processes, but agrees that incrementing the variable signals the wrong thing to the reader.
ok millert@ deraadt@
show more ...
|