Maria Matejka
825be30115
fixup! IO: Allow to take new loops if the thread is hot, but only one at time
2024-06-27 14:25:06 +02:00
Maria Matejka
5288e22d22
fixup! fixup! show threads: displaying the same thread id's as in log
2024-06-27 14:19:29 +02:00
Maria Matejka
8d3a5cad41
fixup! show threads: displaying the same thread id's as in log
2024-06-27 14:15:01 +02:00
Maria Matejka
71d362d439
show threads: displaying the same thread id's as in log
2024-06-27 14:04:26 +02:00
Maria Matejka
8424941f95
Forbid locking altogether when RCU reader is active
2024-06-27 08:42:18 +02:00
Maria Matejka
e2a427fc30
Flush deferred calls directly after the loop finished its one run
2024-06-27 08:37:05 +02:00
Maria Matejka
2bf28e790e
IO: Allow to take new loops if the thread is hot, but only one at time
2024-06-27 08:26:00 +02:00
Maria Matejka
b797444e94
Merge commit 'b95dc8f29f18eb177f91fdc4bf0716fac9b15366' into mq-config-ref
...
Also converted all _Bool's to bool.
2024-06-26 17:19:24 +02:00
Maria Matejka
2a6fe617b1
IO: allow for faster loop dropping
2024-06-26 11:30:48 +02:00
Maria Matejka
2c4b368176
RPKI socket read is prioritized over other sockets
2024-06-26 11:29:43 +02:00
Maria Matejka
dda37842dc
No page flush before polling
...
The maximum amount of locally kept pages is 128 so we can just
well keep the half-meg of RAM allocated and prepared for future use.
2024-06-18 11:02:51 +02:00
Maria Matejka
61dcbb1d83
Global runtime values separated from config
2024-06-14 23:16:07 +02:00
Maria Matejka
5c8179d63a
Time accounting must be done by coarse timers
...
on some ARM, the precise timers are too slow to be actually useful
2024-06-12 14:48:33 +02:00
Maria Matejka
2e882d4a7d
IO Loop: process socket reads only after timers and events are done
2024-06-12 14:48:33 +02:00
Maria Matejka
50d7287741
IO Threads: scheduler debug shows info on next loop to run
2024-06-12 14:48:33 +02:00
Maria Matejka
1180f25123
Threads: smoothening loop pickup and less aggressive dropping
2024-06-12 14:48:33 +02:00
Maria Matejka
8ad9c946e1
IO loop picker fixed
...
Now if the thread finds out that it actually isn't busy,
it unsets the business status and picks something up right away.
2024-06-12 14:48:33 +02:00
Maria Matejka
4bca3b9f86
Task-in-limit checker hacked for mainloop
2024-06-12 14:48:33 +02:00
Maria Matejka
661193cf98
Thread IO: a little bit faster RX repeat
2024-06-12 14:48:33 +02:00
Maria Matejka
bf961ba405
Threads shouldn't drop stopping loops
2024-06-12 09:23:50 +02:00
Maria Matejka
0fb9177374
Loop scheduler tracing options configurable
2024-06-12 09:23:50 +02:00
Maria Matejka
67e9a37291
Fixed nanoseconds in IO loop time limiter
2024-06-12 09:23:50 +02:00
Maria Matejka
6ffab25f01
IO loop: fixed unassigned count
2024-06-04 22:20:18 +02:00
Maria Matejka
423eaf3438
Softened warning about too much time spent in loop
...
Now the warning needs at least 10 ms after the scheduled end time
to ever complain.
TODO: make this configurable
2024-06-04 22:20:18 +02:00
Maria Matejka
2705c385c0
Never allow more than 300 ms per loop
2024-06-04 10:11:36 +02:00
Maria Matejka
dc416d2de3
RCU: Rewritten to be more straightforward
2024-06-04 10:11:36 +02:00
Maria Matejka
b5f803ce4a
Simplified temporary resources
...
Also TMP_SAVED now uses the CLEANUP hook to allow for breaks and returns
2024-05-25 19:37:16 +02:00
Maria Matejka
76ca53e4f8
SKIP_BACK_DECLARE: easier embedded-to-parent typecasting
2024-05-25 19:37:16 +02:00
Maria Matejka
29cd2c0170
Refactored the deferring framework into a separate structure
2024-05-22 11:34:34 +02:00
Maria Matejka
2b38a833cd
Avoiding RCU synchronization deadlock when locking in critical section
...
Explicitly marking domains eligible for RCU synchronization. It's then
forbidden to lock these domains in RCU critical section to avoid
possible deadlock.
2024-05-22 11:34:34 +02:00
Maria Matejka
6a13c02d3b
Removed the obsolete birdloop flagger
...
This was useful when events were locking. As now sending events is lockless,
we can drop this obsolete routine for good.
2024-05-22 11:34:34 +02:00
Maria Matejka
4b9d12708e
Loop run waits until pingers finish
...
This ensures that if somebody passes an event to a loop which
has just started executing, then the event gets picked up. Otherwise
there is a race condition causing stray events pending in queue
but without the ping (because the run actually finishes too fast
to pickup the later events).
2024-05-18 15:50:03 +02:00
Maria Matejka
67f6ac1628
IO Loop: provide information about current loop and task time limit
2024-05-18 15:48:03 +02:00
Maria Matejka
b1b3c7aac2
Allowing to send events to the metaloop's priority list
2024-05-18 15:48:03 +02:00
Maria Matejka
418578bc6b
IO loop: fixed local hot page cache flushing condition
2024-05-18 15:48:03 +02:00
Maria Matejka
5a916ed53f
Locking: Dropping DEFINE_DOMAIN ugly macro
2023-12-04 10:39:32 +01:00
Maria Matejka
c7cc1ccd2e
Merge branch 'mq-aggregator-for-v3' into thread-next
2023-11-09 15:50:13 +01:00
Maria Matejka
796f0af0cc
Fixes to root pool and meta loop to allow resource dumps
2023-11-01 18:23:43 +01:00
Maria Matejka
427177edb7
Logging now doesn't lock with each message
...
The original logging routines were locking a common mutex. This led to
massive underperformance and unwanted serialization when heavily logging
due to lock contention. Now the logging is lockless, though still
serializing on write() syscalls to the same filedescriptor.
This change also brings in a persistent logging channel structures and
thus avoids writing into active configuration data structures during
regular run.
2023-09-24 20:43:04 +02:00
Maria Matejka
3c9429a282
Threads: added a generic method to run in all threads
2023-09-24 20:40:07 +02:00
Maria Matejka
6a3e5c2ae8
Fixed abort when running in foreground but stdin is closed
...
A forgotten else-clause caused BIRD to treat some pseudo-random place in
memory as fd-pair. This was happening only on startup of the first
thread in group and the value there in memory was typically zero ... and
writing to stdin succeeded.
When running BIRD with stdin not present (like systemd does), it died on
this spurious write. Now it seems to work correctly.
Thanks to Daniel Suchy <danny@danysek.cz> for reporting.
http://trubka.network.cz/pipermail/bird-users/2023-May/016929.html
2023-05-13 20:33:35 +02:00
Maria Matejka
92d934f0d1
Fix use-after free in thread stopping code
2023-05-11 11:41:01 +02:00
Maria Matejka
b36d284788
Threads take loops faster
2023-05-11 11:41:01 +02:00
Maria Matejka
cb51ff1fbb
IO Loop / Thread Groups Lock moved to level -attrs- to allow for page allocation while locked
2023-05-07 16:59:19 +02:00
Maria Matejka
62432affd9
Fixed loop movement to not collide on LTT_MOVE
2023-05-07 16:58:56 +02:00
Maria Matejka
e0c09e6bee
Fix loop dropping routines
2023-05-07 16:58:52 +02:00
Maria Matejka
fa973c2c15
First try of loop balancing
...
If a thread encounters timeout == 0 for poll, it considers itself
"busy" and with some hysteresis it tries to drop loops for others to
pick and thus better distribute work between threads.
2023-05-06 10:50:26 +02:00
Maria Matejka
9bc5cbd3c7
Show threads: Fixed problems with CLI buffer reallocation
...
... by allocating all the output locally and then sending it out at
once.
2023-05-03 21:30:29 +02:00
Maria Matejka
8bc27583ff
Explicitly counting loops and threads
2023-05-03 21:30:29 +02:00
Maria Matejka
9c22310612
Loop spent time refactored to separate structures and functions
2023-05-03 21:30:29 +02:00