#
6161b98c |
| 17-May-2018 |
Matt Macy <mmacy@FreeBSD.org> |
hwpmc: Implement per-thread counters for PMC sampling
This implements per-thread counters for PMC sampling. The thread descriptors are stored in a list attached to the process descriptor. These thre
hwpmc: Implement per-thread counters for PMC sampling
This implements per-thread counters for PMC sampling. The thread descriptors are stored in a list attached to the process descriptor. These thread descriptors can store any per-thread information necessary for current or future features. For the moment, they just store the counters for sampling.
The thread descriptors are created when the process descriptor is created. Additionally, thread descriptors are created or freed when threads are started or stopped. Because the thread exit function is called in a critical section, we can't directly free the thread descriptors. Hence, they are freed to a cache, which is also used as a source of allocations when needed for new threads.
Approved by: sbruno Obtained from: jtl Sponsored by: Juniper Networks, Limelight Networks Differential Revision: https://reviews.freebsd.org/D15335
show more ...
|
#
b9408863 |
| 18-Apr-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Add PROC_PDEATHSIG_SET to procctl interface.
Allow processes to request the delivery of a signal upon death of their parent process. Supposed consumer of the feature is PostgreSQL.
Submitted by: T
Add PROC_PDEATHSIG_SET to procctl interface.
Allow processes to request the delivery of a signal upon death of their parent process. Supposed consumer of the feature is PostgreSQL.
Submitted by: Thomas Munro Reviewed by: jilles, mjg MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15106
show more ...
|
#
ed9e8bc4 |
| 24-Mar-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Account the size of the vslock-ed memory by the thread. Assert that all such memory is unwired on return to usermode.
The count of the wired memory will be used to detect the copyout mode.
Tested b
Account the size of the vslock-ed memory by the thread. Assert that all such memory is unwired on return to usermode.
The count of the wired memory will be used to detect the copyout mode.
Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
#
72bfb31a |
| 13-Jan-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r327886 through r327930.
|
#
3f289c3f |
| 12-Jan-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically.
Implement domainset based iterators in the page laye
Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically.
Implement domainset based iterators in the page layer.
Remove the now legacy numa_* syscalls.
Cleanup some header polution created by having seq.h in proc.h.
Reviewed by: markj, kib Discussed with: alc Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D13403
show more ...
|
#
8a36da99 |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/kern: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone
sys/kern: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
#
f8190300 |
| 10-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325505 through r325662.
|
#
2ca45184 |
| 09-Nov-2017 |
Matt Joras <mjoras@FreeBSD.org> |
Introduce EVENTHANDLER_LIST and some users.
This introduces a facility to EVENTHANDLER(9) for explicitly defining a reference to an event handler list. This is useful since previously all invokers o
Introduce EVENTHANDLER_LIST and some users.
This introduces a facility to EVENTHANDLER(9) for explicitly defining a reference to an event handler list. This is useful since previously all invokers of events had to do a locked traversal of the global list of event handler lists in order to find the appropriate event handler list. By keeping a pointer to the appropriate list an invoker can avoid this traversal completely. The pointer is initialized with SYSINIT(9) during the eventhandler stage. Users registering interest in events do not need to know if the event is backed by such a list, since the list is added to the global list of lists. As with lists that are not pre-defined it is safe to register for the events before the list has been created.
This converts the process_* and thread_* events to using the new facility, as these are events whose locked traversals end up showing up significantly in ports build workflows (and presumably other workflows with many short lived threads/procs). It may be advantageous to convert other events to using the new facility.
The el_flags field is now unused, but leave it be so that this revision can be MFC'd.
Reviewed by: bdrewery, markj, mjg Approved by: rstone (mentor) In collaboration with: ian MFC after: 4 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12814
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
4198293b |
| 17-Jun-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r319801 through r320041.
|
#
2d88da2f |
| 12-Jun-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Move struct syscall_args syscall arguments parameters container into struct thread.
For all architectures, the syscall trap handlers have to allocate the structure on the stack. The structure takes
Move struct syscall_args syscall arguments parameters container into struct thread.
For all architectures, the syscall trap handlers have to allocate the structure on the stack. The structure takes 88 bytes on 64bit arches which is not negligible. Also, it cannot be easily found by other code, which e.g. caused duplication of some members of the structure to struct thread already. The change removes td_dbg_sc_code and td_dbg_sc_nargs which were directly copied from syscall_args.
The structure is put into the copied on fork part of the struct thread to make the syscall arguments information correct in the child after fork.
This move will also allow several more uses shortly.
Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks X-Differential revision: https://reviews.freebsd.org/D11080
show more ...
|
#
be27b311 |
| 04-May-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r317503 through r317807.
|
#
acd9f517 |
| 27-Apr-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Add asserts to verify stability of struct proc and struct thread layouts.
Some notes: - Only i386 and amd64 layouts are checked, other Tier-1 (or close to it) architectures would benefit from the
Add asserts to verify stability of struct proc and struct thread layouts.
Some notes: - Only i386 and amd64 layouts are checked, other Tier-1 (or close to it) architectures would benefit from the same check. - Unconditional enabling of the asserts depend on the stability of locks memory layout. If locks are optimized to avoid bloat when some debugging or profiling features turned off, it makes sense to only assert layout for production configs.
Reviewed by: badger, emaste, jhb, vangyzen Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D10526
show more ...
|
#
554491ff |
| 20-Apr-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r316992 through r317215.
|
#
83c9dea1 |
| 17-Apr-2017 |
Gleb Smirnoff <glebius@FreeBSD.org> |
- Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to c
- Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to counter(9). - Since some vmmeter stats may be touched at very early stages of boot, before we have set up UMA and we can do counter_u64_alloc(), provide an early counter mechanism: o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, so that at early stages of boot, before counters are allocated we already point to a counter that can be safely written to. o For sparc64 that required a whole dummy pcpu[MAXCPU] array.
Further related changes: - Don't include vmmeter.h into pcpu.h. - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, to match kernel representation. - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion.
This is based on benno@'s 4-year old patch: https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html
Reviewed by: kib, gallatin, marius, lidl Differential Revision: https://reviews.freebsd.org/D10156
show more ...
|
#
9ed01c32 |
| 17-Apr-2017 |
Gleb Smirnoff <glebius@FreeBSD.org> |
All these files need sys/vmmeter.h, but now they got it implicitly included via sys/pcpu.h.
|
#
6c9271a9 |
| 11-Mar-2017 |
Andriy Gapon <avg@FreeBSD.org> |
actually implement proc:::lwp-exit probe
MFC after: 4 days
|
#
d630701f |
| 25-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r314178 through r314269.
|
#
aca4bb91 |
| 25-Feb-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Do not leak mount references for dying threads.
Thread might create a condition for delayed SU cleanup, which creates a reference to the mount point in td_su, but exit without returning through user
Do not leak mount references for dying threads.
Thread might create a condition for delayed SU cleanup, which creates a reference to the mount point in td_su, but exit without returning through userret(), e.g. when terminating due to single-threading or process exit. In this case, td_su reference is not dropped and mount point cannot be freed.
Handle the situation by clearing td_su also in the thread destructor and in exit1(). softdep_ast_cleanup() has to receive the thread as argument, since e.g. thread destructor is executed in different context.
Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
#
1a36faad |
| 11-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r313301 through r313643.
|
#
4a2dbde7 |
| 07-Feb-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r313398
|
#
f743ea96 |
| 07-Feb-2017 |
Mateusz Guzik <mjg@FreeBSD.org> |
Bump struct thread alignment to 32.
This gives additional bits to use in locking primitives which store the lock thread pointer in the lock value.
Discussed with: kib
|
Revision tags: release/11.0.1, release/11.0.0 |
|
#
27067774 |
| 16-Aug-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r303250 through r304235.
|
#
2d19b736 |
| 28-Jul-2016 |
Konstantin Belousov <kib@FreeBSD.org> |
Rewrite subr_sleepqueue.c use of callouts to not depend on the specifics of callout KPI. Esp., do not depend on the exact interface of callout_stop(9) return values.
The main change is that instead
Rewrite subr_sleepqueue.c use of callouts to not depend on the specifics of callout KPI. Esp., do not depend on the exact interface of callout_stop(9) return values.
The main change is that instead of requiring precise callouts, code maintains absolute time to wake up. Callouts now should ensure that a wake occurs at the requested moment, but we can tolerate both run-away callout, and callout_stop(9) lying about running callout either way.
As consequence, it removes the constant source of the bugs where sleepq_check_timeout() causes uninterruptible thread state where the thread is detached from CPU, see e.g. r234952 and r296320.
Patch also removes dual meaning of the TDF_TIMEOUT flag, making code (IMO much) simpler to reason about.
Tested by: pho Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7137
show more ...
|
#
46e47c4f |
| 03-Jul-2016 |
Konstantin Belousov <kib@FreeBSD.org> |
Provide helper macros to detect 'non-silent SBDRY' state and to calculate appropriate return value for stops. Simplify the code by using them.
Fix typo in sig_suspend_threads(). The thread which s
Provide helper macros to detect 'non-silent SBDRY' state and to calculate appropriate return value for stops. Simplify the code by using them.
Fix typo in sig_suspend_threads(). The thread which sleep must be aborted is td2. (*)
In issignal(), when handling stopping signal for thread in TD_SBDRY_INTR state, do not stop, this is wrong and fires assert. This is yet another place where execution should be forced out of SBDRY-protected region. For such case, return -1 from issignal() and translate it to corresponding error code in sleepq_catch_signals(). Assert that other consumers of cursig() are not affected by the new return value. (*)
Micro-optimize, mostly VFS and VOP methods, by avoiding calling the functions when SIGDEFERSTOP_NOP non-change is requested. (**)
Reported and tested by: pho (*) Requested by: bde (**) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
show more ...
|
#
3a1e5dd8 |
| 26-Jun-2016 |
Konstantin Belousov <kib@FreeBSD.org> |
Rewrite sigdeferstop(9) and sigallowstop(9) into more flexible framework allowing to set the suspension policy for the dynamic block. Extend the currently possible policies of stopping on interruptib
Rewrite sigdeferstop(9) and sigallowstop(9) into more flexible framework allowing to set the suspension policy for the dynamic block. Extend the currently possible policies of stopping on interruptible sleeps and ignoring such sleeps by two more: do not suspend at interruptible sleeps, but interrupt them with either EINTR or ERESTART.
Reviewed by: jilles Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
show more ...
|