#
b7b78c1c |
| 28-Mar-2024 |
Randall Stewart <rrs@FreeBSD.org> |
Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold
HPTS inserts a softclock for system call return that optimizes performance. However when n
Optimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold
HPTS inserts a softclock for system call return that optimizes performance. However when no HPTS threads need the help (i.e. when they have less than 100 or so connections) then there should be little work done i.e. check the counter and return instead of running through all the threads getting locks etc.ptimize HPTS so that little work is done until we have a hpts thread that is over the connection threshold.
Reported by: eduardo Reviewed by: gallatin, glebius, tuexen Tested by: gallatin Differential Revision: https://reviews.freebsd.org/D44420
show more ...
|
Revision tags: release/13.3.0 |
|
#
e3cbc572 |
| 04-Dec-2023 |
Gleb Smirnoff <glebius@FreeBSD.org> |
kern/subr_trap.c: repair the HPTS performance hack in userret()
It wasn't functional as subr_trap.c doesn't include opt_inet.h. Put a better comment provided by gallatin@ in place of the old one.
kern/subr_trap.c: repair the HPTS performance hack in userret()
It wasn't functional as subr_trap.c doesn't include opt_inet.h. Put a better comment provided by gallatin@ in place of the old one. The idea is to use userret() as a cheap place to call a soft clock. This approach saves CPU on busy machines and saves power on idle machines. An alternative would be to constantly schedule callouts. Running with neither callouts nor the soft clock ruins HPTS precision.
Reviewed by: tuexen, rrs Differential Revision: https://reviews.freebsd.org/D42860
show more ...
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
c159f767 |
| 13-Apr-2023 |
Gordon Bergling <gbe@FreeBSD.org> |
kern: remove a double word in a KASSERT in subr_trap
- s/with with/with/
MFC after: 5 days
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
c46771a7 |
| 25-Jul-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
kern/subr_trap.c: cleanup no longer needed headers
Also bump Foundation' copyright year
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revisio
kern/subr_trap.c: cleanup no longer needed headers
Also bump Foundation' copyright year
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D35888
show more ...
|
#
c6d31b83 |
| 18-Jul-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
AST: rework
Make most AST handlers dynamically registered. This allows to have subsystem-specific handler source located in the subsystem files, instead of making subr_trap.c aware of it. For inst
AST: rework
Make most AST handlers dynamically registered. This allows to have subsystem-specific handler source located in the subsystem files, instead of making subr_trap.c aware of it. For instance, signal delivery code on return to userspace is now moved to kern_sig.c.
Also, it allows to have some handlers designated as the cleanup (kclear) type, which are called both at AST and on thread/process exit. For instance, ast(), exit1(), and NFS server no longer need to be aware about UFS softdep processing.
The dynamic registration also allows third-party modules to register AST handlers if needed. There is one caveat with loadable modules: the code does not make any effort to ensure that the module is not unloaded before all threads processed through AST handler in it. In fact, this is already present behavior for hwpmc.ko and ufs.ko. I do not think it is worth the efforts and the runtime overhead to try to fix it.
Reviewed by: markj Tested by: emaste (arm64), pho Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D35888
show more ...
|
Revision tags: release/13.1.0 |
|
#
b53133a7 |
| 12-Feb-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
proc: load/store p_cowgen using atomic primitives
|
#
626d6992 |
| 26-Dec-2021 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Move fork_rfppwait() check into ast()
This will always sleep at least once, so it's a slow path by definition.
Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.or
Move fork_rfppwait() check into ast()
This will always sleep at least once, so it's a slow path by definition.
Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D33387
show more ...
|
Revision tags: release/12.3.0 |
|
#
98168a6e |
| 06-Sep-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
kqueue: drain kqueue taskqueue if syscall tickled it
Otherwise return from the syscall and next syscall, which could be kevent(2) on the kqueue that should be notified, races with the kqueue taskque
kqueue: drain kqueue taskqueue if syscall tickled it
Otherwise return from the syscall and next syscall, which could be kevent(2) on the kqueue that should be notified, races with the kqueue taskqueue thread, and potentially misses the wakeup. This is reliably visible when kevent(2) only peeks into events using zeroed timeout.
PR: 258310 Reported by: arichardson, Jan Kokemüller <jan.kokemueller@gmail.com> Reviewed by: arichardson, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31858
show more ...
|
#
b0f71f1b |
| 10-Aug-2021 |
Mark Johnston <markj@FreeBSD.org> |
amd64: Add MD bits for KMSAN
Interrupt and exception handlers must call kmsan_intr_enter() prior to calling any C code. This is because the KMSAN runtime maintains some TLS in order to track initia
amd64: Add MD bits for KMSAN
Interrupt and exception handlers must call kmsan_intr_enter() prior to calling any C code. This is because the KMSAN runtime maintains some TLS in order to track initialization state of function parameters and return values across function calls. Then, to ensure that this state is kept consistent in the face of asynchronous kernel-mode excpeptions, the runtime uses a stack of TLS blocks, and kmsan_intr_enter() and kmsan_intr_leave() push and pop that stack, respectively.
Use these functions in amd64 interrupt and exception handlers. Note that handlers for user->kernel transitions need not be annotated.
Also ensure that trap frames pushed by the CPU and by handlers are marked as initialized before they are used.
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31467
show more ...
|
#
d7955cc0 |
| 06-Jul-2021 |
Randall Stewart <rrs@FreeBSD.org> |
tcp: HPTS performance enhancements
HPTS drives both rack and bbr, and yet there have been many complaints about performance. This bit of work restructures hpts to help reduce CPU overhead. It does t
tcp: HPTS performance enhancements
HPTS drives both rack and bbr, and yet there have been many complaints about performance. This bit of work restructures hpts to help reduce CPU overhead. It does this by now instead of relying on the timer/callout to drive it instead use user return from a system call as well as lro flushes to drive hpts. The timer becomes a backstop that dynamically adjusts based on how "late" we are.
Reviewed by: tuexen, glebius Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D31083
show more ...
|
Revision tags: release/13.0.0 |
|
#
57f22c82 |
| 11-Jan-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
sigfastblock: do not skip cursig/postsig loop in ast()
Even if sigfastblock block is non-zero, non-blockable signals must be checked on ast and delivered now. This also affects debugger ability to
sigfastblock: do not skip cursig/postsig loop in ast()
Even if sigfastblock block is non-zero, non-blockable signals must be checked on ast and delivered now. This also affects debugger ability to attach, because issignal() also calls ptracestop() if there is a pending stop for debugee.
Instead of checking for sigfastblock, and either setting PENDING flag for usermode or doing signal delivery loop, always do the loop after checking, and then handle PENDING bit. issignal() already does the right thing for fast-blocked case, allowing only STOPs and SIGKILL delivery to happen.
Reported by: Vasily Postnicov <shamaz.mazum@gmail.com>, markj Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28089
show more ...
|
Revision tags: release/12.2.0 |
|
#
46588778 |
| 03-Oct-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Move KTRUSERRET() from userret() to ast(). It's a really long detour - it writes ktrace entries to the filesystem - so the overhead of ast() won't make any difference.
Reviewed by: kib Sponsored by
Move KTRUSERRET() from userret() to ast(). It's a really long detour - it writes ktrace entries to the filesystem - so the overhead of ast() won't make any difference.
Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26404
show more ...
|
#
fecb19e4 |
| 14-Sep-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Move td_softdep_cleanup() from userret() to ast(); it's infrequent at best. The schedule_cleanup() function already sets TDF_ASTPENDING.
Reviewed by: kib, mckusick Tested by: pho MFC after: 2 weeks
Move td_softdep_cleanup() from userret() to ast(); it's infrequent at best. The schedule_cleanup() function already sets TDF_ASTPENDING.
Reviewed by: kib, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26375
show more ...
|
#
60f083ef |
| 14-Sep-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Move TDP_GEOM check from userret() to ast(); this code path is quite infrequent.
Reviewed by: kib No objections: mav Tested by: pho MFC after: 2 weeks Sponsored by: DARPA Differential Revision: http
Move TDP_GEOM check from userret() to ast(); this code path is quite infrequent.
Reviewed by: kib No objections: mav Tested by: pho MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26374
show more ...
|
#
30d158ee |
| 14-Sep-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Move racct/rctl throttling from userret() to ast(). There's no reason for it to sit in the syscall fast path.
Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://
Move racct/rctl throttling from userret() to ast(). There's no reason for it to sit in the syscall fast path.
Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26368
show more ...
|
#
022c2f55 |
| 09-Sep-2020 |
Gleb Smirnoff <glebius@FreeBSD.org> |
In r354148 the goal was to check THREAD_CAN_SLEEP() only once for the purpose of epoch_trace() and for calling subsequent panic, but to keep code fully under INVARIANTS, so don't use bare function ca
In r354148 the goal was to check THREAD_CAN_SLEEP() only once for the purpose of epoch_trace() and for calling subsequent panic, but to keep code fully under INVARIANTS, so don't use bare function call to panic(). However, at the last stage of review a true value slipped in, while always false was assumed. I checked that in email archive with kib@.
Noticed by: trasz
show more ...
|
Revision tags: release/11.4.0 |
|
#
59838c1a |
| 01-Apr-2020 |
John Baldwin <jhb@FreeBSD.org> |
Retire procfs-based process debugging.
Modern debuggers and process tracers use ptrace() rather than procfs for debugging. ptrace() has a supserset of functionality available via procfs and new deb
Retire procfs-based process debugging.
Modern debuggers and process tracers use ptrace() rather than procfs for debugging. ptrace() has a supserset of functionality available via procfs and new debugging features are only added to ptrace(). While the two debugging services share some fields in struct proc, they each use dedicated fields and separate code. This results in extra complexity to support a feature that hasn't been enabled in the default install for several years.
PR: 244939 (exp-run) Reviewed by: kib, mjg (earlier version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D23837
show more ...
|
#
0bc52b0b |
| 10-Mar-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Return reschedule_signals() to being static again.
It was used after sigfastblock_setpend() call in in ast() when current thread fast-blocks signals. Add a flag to sigfastblock_setpend() to request
Return reschedule_signals() to being static again.
It was used after sigfastblock_setpend() call in in ast() when current thread fast-blocks signals. Add a flag to sigfastblock_setpend() to request reschedule, and remove the direct use of the function from subr_trap.c
Tested by: pho Sponsored by: The FreeBSD Foundation
show more ...
|
#
24a22d1d |
| 22-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge r358179 through r358238.
PR: 244251
|
#
74cb9a53 |
| 20-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Fix a bug in r358168, do not call sigfastblock_setpend() under a mutex.
PR: 244250 Reported and tested by: lwhsu Sponsored by: The FreeBSD Foundation
|
#
6c140a72 |
| 20-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358131 through r358178.
|
#
a113b17f |
| 20-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Do not read sigfastblock word on syscall entry.
On machines with SMAP, fueword executes two serializing instructions which can be seen in microbenchmarks.
As a measure to restore microbenchmark num
Do not read sigfastblock word on syscall entry.
On machines with SMAP, fueword executes two serializing instructions which can be seen in microbenchmarks.
As a measure to restore microbenchmark numbers, only read the word on the attempt to deliver signal in ast(). If the word is set, signal is not delivered and word is kept, preventing interruption of interruptible sleeps by signals until userspace calls sigfastblock(UNBLOCK) which clears the word.
This way, the spurious EINTR that userspace can see while in critical section is on first interruptible sleep, if a signal is pending, and on signal posting. It is believed that it is not important for rtld and lbithr critical sections. It might be visible for the application code e.g. for the callback of dl_iterate_phdr(3), but again the belief is that the non-compliance is acceptable. Most important is that the retry of the sleeping syscall does not interrupt unless additional signal is posted.
For now I added the knob kern.sigfastblock_fetch_always to enable the word read on syscall entry to be able to diagnose possible issues due to spurious EINTR.
While there, do some code restructuting to have all sigfastblock() handling located in kern_sig.c.
Reviewed by: jeff Discussed with: mjg Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23622
show more ...
|
#
74dc6beb |
| 14-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357855 through r357920.
|