#
811d05fc |
| 19-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
Provide an API for interlocked refcount sleeps.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22908
|
#
879e0604 |
| 12-Jan-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
Add KERNEL_PANICKED macro for use in place of direct panicstr tests
|
#
fea73412 |
| 24-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
sleep(9), sleepqueue(9): const'ify wchan pointers
_sleep(9), wakeup(9), sleepqueue(9), et al do not dereference or modify the channel pointers provided in any way; they are merely used as intptrs in
sleep(9), sleepqueue(9): const'ify wchan pointers
_sleep(9), wakeup(9), sleepqueue(9), et al do not dereference or modify the channel pointers provided in any way; they are merely used as intptrs into a dictionary structure to match waiters with wakers. Correctly annotate this such that _sleep() and wakeup() may be used on const pointers without invoking ugly patterns like __DECONST(). Plumb const through all of the underlying sleepqueue bits.
No functional change.
Reviewed by: rlibby Discussed with: kib, markj Differential Revision: https://reviews.freebsd.org/D22914
show more ...
|
#
e30f025f |
| 24-Dec-2019 |
Conrad Meyer <cem@FreeBSD.org> |
kern_synch: Fix some UB
It is UB to evaluate pointer comparisons when pointers do not point within the same object. Instead, convert the pointers to numbers and compare the numbers.
Reported by: k
kern_synch: Fix some UB
It is UB to evaluate pointer comparisons when pointers do not point within the same object. Instead, convert the pointers to numbers and compare the numbers.
Reported by: kib Discussed with: rlibby
show more ...
|
#
686bcb5c |
| 15-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
schedlock 4/4
Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption dis
schedlock 4/4
Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch.
This change has not been made to 4BSD but in principle it would be more straightforward.
Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778
show more ...
|
#
61a74c5c |
| 15-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
schedlock 1/4
Eliminate recursion from most thread_lock consumers. Return from sched_add() without the thread_lock held. This eliminates unnecessary atomics and lock word loads as well as reducing
schedlock 1/4
Eliminate recursion from most thread_lock consumers. Return from sched_add() without the thread_lock held. This eliminates unnecessary atomics and lock word loads as well as reducing the hold time for scheduler locks. This will eventually allow for lockless remote adds.
Discussed with: kib Reviewed by: jhb Tested by: pho Differential Revision: https://reviews.freebsd.org/D22626
show more ...
|
Revision tags: release/12.1.0 |
|
#
5757b59f |
| 29-Oct-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Merge td_epochnest with td_no_sleeping.
Epoch itself doesn't rely on the counter and it is provided merely for sleeping subsystems to check it.
- In functions that sleep use THREAD_CAN_SLEEP() to a
Merge td_epochnest with td_no_sleeping.
Epoch itself doesn't rely on the counter and it is provided merely for sleeping subsystems to check it.
- In functions that sleep use THREAD_CAN_SLEEP() to assert correctness. With EPOCH_TRACE compiled print epoch info. - _sleep() was a wrong place to put the assertion for epoch, right place is sleepq_add(), as there ways to call the latter bypassing _sleep(). - Do not increase td_no_sleeping in non-preemptible epochs. The critical section would trigger all possible safeguards, no sleeping counter is extraneous.
Reviewed by: kib
show more ...
|
#
4b25d1f2 |
| 15-Oct-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
Missing from r353596.
|
#
bac06038 |
| 15-Oct-2019 |
Gleb Smirnoff <glebius@FreeBSD.org> |
When assertion for a thread not being in an epoch fails also print all entered epochs. Works with EPOCH_TRACE only.
Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D22017
|
#
33205c60 |
| 18-Aug-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Add a blocking wait bit to refcount. This allows refs to be used as a simple barrier.
Reviewed by: markj, kib Discussed with: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebs
Add a blocking wait bit to refcount. This allows refs to be used as a simple barrier.
Reviewed by: markj, kib Discussed with: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21254
show more ...
|
Revision tags: release/11.3.0 |
|
#
e532a999 |
| 20-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349234
Sponsored by: The FreeBSD Foundation
|
#
f91aa773 |
| 20-Jun-2019 |
Alexander Motin <mav@FreeBSD.org> |
Add wakeup_any(), cheaper wakeup_one() for taskqueue(9).
wakeup_one() and underlying sleepq_signal() spend additional time trying to be fair, waking thread with highest priority, sleeping longest ti
Add wakeup_any(), cheaper wakeup_one() for taskqueue(9).
wakeup_one() and underlying sleepq_signal() spend additional time trying to be fair, waking thread with highest priority, sleeping longest time. But in case of taskqueue there are many absolutely identical threads, and any fairness between them is quite pointless. It makes even worse, since round-robin wakeups not only make previous CPU affinity in scheduler quite useless, but also hide from user chance to see CPU bottlenecks, when sequential workload with one request at a time looks evenly distributed between multiple threads.
This change adds new SLEEPQ_UNFAIR flag to sleepq_signal(), making it wakeup thread that went to sleep last, but no longer in context switch (to avoid immediate spinning on the thread lock). On top of that new wakeup_any() function is added, equivalent to wakeup_one(), but setting the flag. On top of that taskqueue(9) is switchied to wakeup_any() to wakeup its threads.
As result, on 72-core Xeon v4 machine sequential ZFS write to 12 ZVOLs with 16KB block size spend 34% less time in wakeup_any() and descendants then it was spending in wakeup_one(), and total write throughput increased by ~10% with the same as before CPU usage.
Reviewed by: markj, mmacy MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D20669
show more ...
|
#
67350cb5 |
| 09-Dec-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340918 through r341763.
|
#
13a45e4b |
| 08-Dec-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Provide SDT_PROBES_ENABLED macro.
Sponsored by: The FreeBSD Foundation
|
Revision tags: release/12.0.0, release/11.2.0 |
|
#
99ece3a9 |
| 22-May-2018 |
Mateusz Guzik <mjg@FreeBSD.org> |
Reduce sdt-related branch-fest in mi_switch.
The code was evaluating flags before resorting to checking if dtrace is enabled. This was inducing forward jumps in the common case.
|
#
891cf3ed |
| 18-May-2018 |
Ed Maste <emaste@FreeBSD.org> |
Use NULL for SYSINIT's last arg, which is a pointer type
Sponsored by: The FreeBSD Foundation
|
#
06bf2a6a |
| 10-May-2018 |
Matt Macy <mmacy@FreeBSD.org> |
Add simple preempt safe epoch API
Read locking is over used in the kernel to guarantee liveness. This API makes it easy to provide livenes guarantees without atomics.
Includes epoch_test kernel mod
Add simple preempt safe epoch API
Read locking is over used in the kernel to guarantee liveness. This API makes it easy to provide livenes guarantees without atomics.
Includes epoch_test kernel module to stress test the API.
Documentation will follow initial use case.
Test case and improvements to preemption handling in response to discussion with mjg@
Reviewed by: imp@, shurd@ Approved by: sbruno@
show more ...
|
#
2077229b |
| 03-Mar-2018 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag. Define pause_sig() function macro helper similarly to other kernel functions which catch signals. Update outdated function des
Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag. Define pause_sig() function macro helper similarly to other kernel functions which catch signals. Update outdated function description.
Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies
show more ...
|
#
54fc0383 |
| 03-Mar-2018 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Correct the return code from pause() during cold startup from zero to EWOULDBLOCK. This also matches the description in pause(9).
Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Techno
Correct the return code from pause() during cold startup from zero to EWOULDBLOCK. This also matches the description in pause(9).
Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies
show more ...
|
#
4fc74049 |
| 29-Dec-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r327169 through r327340.
|
#
151ba793 |
| 25-Dec-2017 |
Alexander Kabaev <kan@FreeBSD.org> |
Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports.
Reviewed by: kib, andrew(
Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports.
Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385
show more ...
|
#
82725ba9 |
| 23-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325999 through r326131.
|
#
51369649 |
| 20-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for
sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
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.
Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
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 ...
|