0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-20 12:25:20 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
Maria Matejka
571c4f69bf More efficient IO loop event execution to avoid long loops
If there are lots of loops in a single thread and only some of the loops
are actually active, the other loops are now kept aside and not checked
until they actually get some timers, events or active sockets.

This should help with extreme loads like 100k tables and protocols.

Also ping and loop pickup mechanism was allowing subtle race
conditions. Now properly handling collisions between loop ping and pickup.
2023-04-04 17:00:59 +02:00
Maria Matejka
7a262bc999 Adding forgotten pthread.h #include in io-loop.h (breaks at openbsd 7.1) 2023-01-21 23:42:02 +01:00
Maria Matejka
84c298465f Decoupling loops from threads to allow fixed thread count
On large configurations, too many threads would spawn with one thread
per loop. Therefore, threads may now run multiple loops at once. The
thread count is configurable and may be changed during run. All threads
are spawned on startup.

This change helps with memory bloating. BIRD filters need large
temporary memory blocks to store their stack and also memory management
keeps its hot page storage per-thread.

Known bugs:
* Thread autobalancing is not yet implemented.
* Low latency loops are executed together with standard loops.
2023-01-19 11:13:50 +01:00
Maria Matejka
6768e0cf9e Pipe kick-and-drain packed into a neat structure and functions. 2022-09-20 17:17:50 +02:00
Maria Matejka
eac6345759 Loop flags: a simple idempotent event announcement mechanism 2022-09-18 16:33:51 +02:00
Maria Matejka
058ed71139 Introducing basic RCU primitives for lock-less shared data structures 2022-08-02 10:00:21 +02:00
Maria Matejka
e858dce757 Moved the thread starting code to IO loop code 2022-07-28 19:49:03 +02:00
Maria Matejka
94eb0858c2 Converting the former BFD loop to a universal IO loop and protocol loop.
There is a simple universal IO loop, taking care of events, timers and
sockets. Primarily, one instance of a protocol should use exactly one IO
loop to do all its work, as is now done in BFD.

Contrary to previous versions, the loop is now launched and cleaned by
the nest/proto.c code, allowing for a protocol to just request its own
loop by setting the loop's lock order in config higher than the_bird.

It is not supported nor checked if any protocol changed the requested
lock order in reconfigure. No protocol should do it at all.
2021-11-22 19:05:43 +01:00
Maria Matejka
c84ed60371 Moved BFD IO loop out of BFD as we want to use it as socket-io coroutine 2021-11-22 19:05:43 +01:00