0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-08 20:28:43 +00:00
Commit Graph

4474 Commits

Author SHA1 Message Date
Maria Matejka
6772db3a71 Threads take loops faster 2023-05-07 23:40:38 +02:00
Maria Matejka
f606f44d1b fixup! Channel: configurable feed block size 2023-05-07 23:39:03 +02:00
Maria Matejka
dd1f1c46cc Channel: configurable feed block size 2023-05-07 23:04:47 +02:00
Maria Matejka
6572aff669 BGP: proactively rehash prefix hash up to shorten collision lists 2023-05-07 21:39:05 +02:00
Maria Matejka
478912c558 Temporary hash function update 2023-05-07 21:19:15 +02:00
Maria Matejka
69c22818fb OLocks in BGP must be freed early 2023-05-07 17:30:33 +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
a95141111c Fixed a bug in hot page global storage
The original algorithm was suffering from an ABA race condition:

A: fp = page_stack
B: completely allocates the same page and writes into it some data
A: unsuspecting, loads (invalid) next = fp->next
B: finishes working with the page and returns it back to page_stack
A: compare-exchange page_stack: fp => next succeeds and writes garbage
to page_stack

Fixed this by using an implicit spinlock in hot page allocator.
2023-05-06 10:50:32 +02:00
Maria Matejka
00f30ac40b Debug: keep a circular log of memory page operations 2023-05-06 10:50:32 +02:00
Maria Matejka
1e998a4349 Fixed cold page cache leak
The empty_pages pointer wasn't being propagated into the ->next pointer
when more empty_pages were to be stored
2023-05-06 10:50:31 +02:00
Maria Matejka
ed91d884d3 Hostentry: fix pool locking 2023-05-06 10:50:31 +02:00
Maria Matejka
7d8e541057 Linpool state save and restore refactoring 2023-05-06 10:50:31 +02:00
Maria Matejka
b21909c6ee Debug: Explicit mprotect() on freed pages to better locate use-after-free bugs 2023-05-06 10:50:31 +02:00
Maria Matejka
fac6405669 Page allocator: indentation of messy ifdef blocks 2023-05-06 10:50:31 +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
9f25dd79b8 Allocation from linpools and slabs requires the appropriate lock to be taken 2023-05-03 21:30:29 +02:00
Maria Matejka
010c26c296 Linpool flushes unused pages even on lp_restore() 2023-05-03 21:30:29 +02:00
Maria Matejka
91471531a1 Fixed race condition in hostentry allocation 2023-05-03 21:30:29 +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
Maria Matejka
ab83bab9d1 Loops track also locking time 2023-04-26 19:34:29 +02:00
Maria Matejka
2ddb34c9d1 IO loops now actually measuring their time (show threads all works) 2023-04-26 19:10:52 +02:00
Maria Matejka
ce7495b49a Refactoring of domains connected to pools 2023-04-25 09:52:28 +02:00
Maria Matejka
19e79eb8ad Fix of failing show threads command 2023-04-24 11:35:05 +02:00
Maria Matejka
db2b67268c Merge commit 'd61505b039bf0aa6697e28b2a4e07907c89ba1fb' into thread-next 2023-04-24 10:40:53 +02:00
Maria Matejka
fa8848aca3 Merge branch 'mq-resource-locking' into thread-next 2023-04-24 10:39:13 +02:00
Maria Matejka
942d3cbcdd Removed duplicate version 3.0-alpha0 news 2023-04-24 10:39:08 +02:00
Maria Matejka
22f54eaee6 Resource pools are now bound with domains.
Memory allocation is a fragile part of BIRD and we need checking that
everybody is using the resource pools in an appropriate way. To assure
this, all the resource pools are associated with locking domains and
every resource manipulation is thoroughly checked whether the
appropriate locking domain is locked.

With transitive resource manipulation like resource dumping or mass free
operations, domains are locked and unlocked on the go, thus we require
pool domains to have higher order than their parent to allow for this
transitive operations.

Adding pool locking revealed some cases of insecure memory manipulation
and this commit fixes that as well.
2023-04-24 10:33:28 +02:00
Maria Matejka
6230d87c74 Protocols and tables now use the birdloop pools as primary 2023-04-22 21:20:19 +02:00
Maria Matejka
1141ce4e2d Resource pool closing has its dedicated function 2023-04-22 20:49:58 +02:00
Maria Matejka
b3f805ce29 Socket closing has its dedicated function 2023-04-22 20:48:42 +02:00
Maria Matejka
074739e0e9 Global protocol list is typed to avoid typecast confusion 2023-04-22 20:48:42 +02:00
Maria Matejka
48dfcb60d6 Typed lists: added add_after() and unit tests 2023-04-22 20:48:42 +02:00
Ondrej Filip
2c809894dc Alpha0 news added 2023-04-21 09:08:54 +02:00
Luiz Amaral
d61505b039 BSD: IPv4 over IPv6 nexthop support on FreeBSD
The support for IPv4 routes with IPv6 nexthops was implemented in FreeBSD
13.1, this patch allows to import and export such routes from/to kernel.

Minor change from committer.
2023-04-21 02:03:31 +02:00
Maria Matejka
335409248e Linpool: Fix lp_restore()
When lp_save() is called on an empty linpool, then some allocation is
done, then lp_restore() is called, the linpool is restored but the used
chunks are inaccessible. Fix it.
2023-04-20 19:33:00 +02:00
Maria Matejka
06963f96b3 Typed lists keep an explicit pointer to the list head.
This change adds one pointer worth of memory to every list node.
Keeping this information helps auditing the lists, checking that the
node indeed is outside of list or inside the right one.

The typed lists shouldn't be used anywhere with memory pressure anyway,
thus the one added pointer isn't significant.
2023-04-19 21:19:10 +02:00
Maria Matejka
67fe3d096d Updated the version number to not include dash (breaks RPM) 2023-04-18 10:11:07 +02:00
Maria Matejka
9f0ef3045d NEWS and version update 2023-04-18 09:52:12 +02:00
Maria Matejka
d975827f5f Merge tag '3.0-alpha0' into HEAD
3.0-alpha0
2023-04-18 09:43:06 +02:00
Maria Matejka
787fb56da3 IO: added a specific loop pickup group for BFD; to be done better in future 2023-04-17 13:30:14 +02:00
Maria Matejka
61e64d6a41 Merge commit '9e44ace3' into thread-next-iface 2023-04-14 15:18:18 +02:00
Maria Matejka
0c9e33fa7a Merge commit 'f881b98d' into thread-next-iface 2023-04-14 14:30:48 +02:00
Maria Matejka
dc75d3e305 Merge commit '231c6385' into thread-next-iface 2023-04-14 14:00:54 +02:00
Maria Matejka
a9db956b61 Merge commit '2f080b54' into thread-next-iface 2023-04-14 13:59:23 +02:00
Maria Matejka
90b9e37bc4 Merge commit '6c058ae4' into thread-next-iface 2023-04-14 13:43:32 +02:00
Maria Matejka
1106927213 Merge commit '913ec57f' into thread-next-iface 2023-04-14 13:43:24 +02:00