#
59abbffa |
| 31-Jan-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357270 through r357349.
|
#
3ff65f71 |
| 30-Jan-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
Remove duplicated empty lines from kern/*.c
No functional changes.
|
#
8e493611 |
| 25-Nov-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
procdesc: allow to collect status through wait(1) if process is traced
The debugger like truss(1) depends on the wait(2) syscall. This syscall waits for ALL children. When it is waiting for ALL chil
procdesc: allow to collect status through wait(1) if process is traced
The debugger like truss(1) depends on the wait(2) syscall. This syscall waits for ALL children. When it is waiting for ALL child's the children created by process descriptors are not returned. This behavior was introduced because we want to implement libraries which may pdfork(1).
The behavior of process descriptor brakes truss(1) because it will not be able to collect the status of processes with process descriptors.
To address this problem the status is returned to parent when the child is traced. While the process is traced the debugger is the new parent. In case the original parent and debugger are the same process it means the debugger explicitly used pdfork() to create the child. In that case the debugger should be using kqueue()/pdwait() instead of wait().
Add test case to verify that. The test case was implemented by markj@.
Reviewed by: kib, markj Discussed with: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20362
show more ...
|
Revision tags: release/12.1.0 |
|
#
c5c3ba6b |
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
#
9576ff58 |
| 02-Sep-2019 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: clear pid bitmap entry after dropping proctree lock
There is no correctness change here, but the procid lock is contended in the fork path and taking it while holding proctree avoidably extend
proc: clear pid bitmap entry after dropping proctree lock
There is no correctness change here, but the procid lock is contended in the fork path and taking it while holding proctree avoidably extends its hold time.
Note that there are other ids which can end up getting cleared with the lock.
Sponsored by: The FreeBSD Foundation
show more ...
|
#
88cc62e5 |
| 28-Aug-2019 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: eliminate the zombproc list
It is not needed by anything in the kernel and it slightly drives up contention on both proctree and allproc locks.
Reviewed by: kib Sponsored by: The FreeBSD Foun
proc: eliminate the zombproc list
It is not needed by anything in the kernel and it slightly drives up contention on both proctree and allproc locks.
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21447
show more ...
|
#
a05cfdf4 |
| 05-Aug-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
exit1: fix style nits
MFC after: 1 month
|
#
799d92ab |
| 05-Aug-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
proc: introduce the proc_add_orphan function
This API allows adding the process to its parent orphan list.
Reviewed by: kib, markj MFC after: 1 month
|
#
41fadb3f |
| 05-Aug-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
exit1: postpone clearing P_TRACED flag until the proctree lock is acquired
In case of the process being debugged. The P_TRACED is cleared very early, which would make procdesc_close() not calling pr
exit1: postpone clearing P_TRACED flag until the proctree lock is acquired
In case of the process being debugged. The P_TRACED is cleared very early, which would make procdesc_close() not calling proc_clear_orphan(). That would result in the debugged process can not be able to collect status of the process with process descriptor.
Reviewed by: markj, kib Tested by: pho MFC after: 1 month
show more ...
|
#
ad13e15e |
| 30-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @350453
Sponsored by: The FreeBSD Foundation
|
#
9db97ca0 |
| 29-Jul-2019 |
Mariusz Zaborski <oshogbo@FreeBSD.org> |
proc: make clear_orphan an public API
This will be useful for other patches with process descriptors. Change its name as well.
Reviewed by: markj, kib
|
Revision tags: release/11.3.0 |
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
daec9284 |
| 21-May-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Include ktr.h in more compilation units
Similar to r348026, exhaustive search for uses of CTRn() and cross reference ktr.h includes. Where it was obvious that an OS compat header of some kind inclu
Include ktr.h in more compilation units
Similar to r348026, exhaustive search for uses of CTRn() and cross reference ktr.h includes. Where it was obvious that an OS compat header of some kind included ktr.h indirectly, .c files were left alone. Some of these files clearly got ktr.h via header pollution in some scenarios, or tinderbox would not be passing prior to this revision, but go ahead and explicitly include it in files using it anyway.
Like r348026, these CUs did not show up in tinderbox as missing the include.
Reported by: peterj (arm64/mp_machdep.c) X-MFC-With: r347984 Sponsored by: Dell EMC Isilon
show more ...
|
#
e2e050c8 |
| 20-May-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially.
EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files.
LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change).
No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
show more ...
|
#
7648bc9f |
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
#
128c9bc0 |
| 07-Apr-2019 |
Mark Johnston <markj@FreeBSD.org> |
Set the p_oppid field of orphans when exiting.
Such processes will be reparented to the reaper when the current parent is done with them (i.e., ptrace detached), so p_oppid must be updated according
Set the p_oppid field of orphans when exiting.
Such processes will be reparented to the reaper when the current parent is done with them (i.e., ptrace detached), so p_oppid must be updated accordingly.
Add a regression test to exercise this code path. Previously it would not be possible to reap an orphan with a stale oppid.
Reviewed by: kib, mjg Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19825
show more ...
|
#
67350cb5 |
| 09-Dec-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340918 through r341763.
|
#
eadb1dcb |
| 08-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: handle sdt exit probe before taking the proc lock
Sponsored by: The FreeBSD Foundation
|
#
b1fbffe7 |
| 07-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: when exiting move to zombproc before taking proctree
The kernel was already doing this prior to r329615. It was changed to reduce contention on allproc. However, introduction of pidhash locks
proc: when exiting move to zombproc before taking proctree
The kernel was already doing this prior to r329615. It was changed to reduce contention on allproc. However, introduction of pidhash locks and removal of proctree -> allproc ordering from fork thanks to bitmaps fixed things enough to make this change pessimal.
waitpid takes proctree on each call and this change (now) causes avoidable stalls if allproc is held.
Sponsored by: The FreeBSD Foundation
show more ...
|
#
34ebdcea |
| 07-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Manage process-related IDs with bitmaps
Currently unique pid allocation on fork often requires a full walk of process, group, session lists to make sure it is not used by anything. This has a side e
Manage process-related IDs with bitmaps
Currently unique pid allocation on fork often requires a full walk of process, group, session lists to make sure it is not used by anything. This has a side effect of requiring proctree to be held along with allproc, which adds more contention in poudriere -j 128.
The patch below implements trivial bitmaps which gets rid of the problem. Dedicated lock is introduced to manage IDs.
While here a bug was discovered: all processes would inherit reap id from the first process spawned by init. This had a side effect of keeping the ID used and when allocation rolls over to the beginning it keeps being skipped.
The patch is loosely based on initial work by mjoras@.
Reviewed by: kib Sponsored by: The FreeBSD Foundation
show more ...
|
Revision tags: release/12.0.0 |
|
#
1e9a1bf5 |
| 29-Nov-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: create a dedicated lock for zombproc to ligthen the load on allproc_lock
waitpid always takes proctree to evaluate the list, but only takes allproc if it can reap. With this patch allproc is n
proc: create a dedicated lock for zombproc to ligthen the load on allproc_lock
waitpid always takes proctree to evaluate the list, but only takes allproc if it can reap. With this patch allproc is no longer taken, which helps during poudriere -j 128.
Discussed with: kib Sponsored by: The FreeBSD Foundation
show more ...
|
#
3d5db455 |
| 24-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340427 through r340868.
|
#
e3d3e828 |
| 23-Nov-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Revert "fork: fix use-after-free with vfork"
This unreliably breaks libc handling of vfork where forking succeded, but execve did not.
vfork code in libc performs waitpid with WNOHANG in case of fa
Revert "fork: fix use-after-free with vfork"
This unreliably breaks libc handling of vfork where forking succeded, but execve did not.
vfork code in libc performs waitpid with WNOHANG in case of failed exec. With the fix exit codepath was waking up the parent before the child fully transitioned to a zombie. Woken up parent would waitpid, which could find a not-yet-zombie child and fail to reap it due to the WNOHANG flag.
While removing the flag fixes the problem, it is not an option due to older releases which would still suffer from the kernel change.
Revert the fix until a solution can be worked out.
Note that while use-after-free which gets back due to the revert is a real bug, it's side-effects are limited due to the fact that struct proc memory is never released by UMA.
show more ...
|
#
b00b27e9 |
| 22-Nov-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
fork: fix use-after-free with vfork
The pointer to the child is stored without any reference held. Then it is blindly used to wait until P_PPWAIT is cleared. However, if the child is autoreaped it c
fork: fix use-after-free with vfork
The pointer to the child is stored without any reference held. Then it is blindly used to wait until P_PPWAIT is cleared. However, if the child is autoreaped it could have exited and get freed before the parent started waiting.
Use the existing hold mechanism to mitigate the problem. Most common case of doing exec remains unchanged. The corner case of doing exit performs wake up before waiting for holds to clear.
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18295
show more ...
|
#
a627b462 |
| 21-Nov-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: update list manipulation comment on process exit
Processes stay in the hash until they get reaped.
This code does not unlink the child from the parent, so remove the claim that it does.
Spon
proc: update list manipulation comment on process exit
Processes stay in the hash until they get reaped.
This code does not unlink the child from the parent, so remove the claim that it does.
Sponsored by: The FreeBSD Foundation
show more ...
|