0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00
bird/lib
Katerina Kubecova b84460432a lockfree.c: Solution for lfjour_cleanup_hook() too often scheduling. This function was scheduled each time any of the journal recipients
reached end of a block of journal items or read all of journal items. lfjour_cleanup_hook() can clean only journal items every recipient has processed,
so it was often called uselessly.

This commit restricts most of the unusefull scheduling. Only some consumers are given a token alowing them to try to schedule the lfjour_cleanup_hook().
When a consumer wants to schedule the lfjour_cleanup_hook(), it checks whether it has a token. If yes, it decrements number of tokens the journal has given (issued_tokens)
and discards its own token. If issued_tokens reaches zero, the consumer is allowed do schedule the lfjour_cleanup_hook().

There is a maximum number of tokens a journal can give to its customers (max_tokens). A new customer is given a token in its init, if the maximum number of tokens was not reached.
The rest of tokens is given to customers in lfjour_cleanup_hook(). In lf_jour_cleanup_hook(), it is increased the issued_tokens number in order not to call the hook
before it finishes. Then, tokens are given to the slowest recipients (but never to more than max_token recipients). Before leaving lfjour_cleanup_hook(),
the issued_tokens number is decreased. If no other tokens are given, we have to make sure the lfjour_cleanup_hook will be called again. If every item in journal
was read by every recipient, tokens are given to random recipients. If all recipients with tokens managed to finish until now, we give the token to first
unfinished customer we find or we call the hook again.
2024-12-10 16:32:38 +01:00
..
a-path_test.c Renamed nest/rt.h back to nest/route.h 2023-10-29 16:29:26 +01:00
a-path.c Merge branch 'mq-aggregator-for-v3' into HEAD 2023-11-01 10:58:31 +01:00
a-set_test.c Merge commit '08571b20' into thread-merge-2.16 2024-11-28 08:22:06 +01:00
a-set.c Merge commit '08571b20' into thread-merge-2.16 2024-11-28 08:22:06 +01:00
alloca.h Several minor fixes 2017-02-20 02:26:45 +01:00
attribute_cleanup_test.c C Compiler Attribute Cleanup Test 2023-11-09 23:08:21 +01:00
attrs.h Merge commit 'a5b4c21d' into thread-merge-2.16 2024-11-28 09:08:32 +01:00
birdlib.h Merge commit 'a5b4c21d' into thread-merge-2.16 2024-11-28 09:08:32 +01:00
bitmap_test.c Lib: Extend MPLS label allocator bitmap 2023-10-04 13:07:33 +02:00
bitmap.c Merge branch 'mq-aggregator-for-v3' into thread-next 2023-11-09 15:34:59 +01:00
bitmap.h Common parts of the ROA updater moved into the table 2024-06-04 10:11:36 +02:00
bitops_test.c Bitops: bitflip function 2024-05-18 15:48:03 +02:00
bitops.c Bitops: bitflip function 2024-05-18 15:48:03 +02:00
bitops.h Bitops: bitflip function 2024-05-18 15:48:03 +02:00
blake2-impl.h Lib: Add Blake2s and Blake2b hash functions 2021-06-06 16:26:58 +02:00
blake2-kat.h Lib: Add tests for blake2s and blake2b 2021-06-06 16:28:09 +02:00
blake2.h Lib: Add Blake2s and Blake2b hash functions 2021-06-06 16:26:58 +02:00
blake2b.c Lib: Add Blake2s and Blake2b hash functions 2021-06-06 16:26:58 +02:00
blake2s.c Lib: Add Blake2s and Blake2b hash functions 2021-06-06 16:26:58 +02:00
buffer_test.c Fixed resource initialization in unit tests 2022-03-09 10:30:42 +01:00
buffer.h Filter: Recursive filter iteration code 2021-02-07 19:21:42 +01:00
checksum_test.c Birdtest: Replace BT_SUCCESS and BT_FAILURE with 1 and 0 2016-11-11 17:43:09 +01:00
checksum.c unsigned [int] -> uint 2015-06-08 02:24:08 +02:00
checksum.h unsigned [int] -> uint 2015-06-08 02:24:08 +02:00
defer.c BGP: Freeing prefixes deferred to save rcu synchronization 2024-06-04 22:20:18 +02:00
defer.h Deferred call may need to be returned for future cleanups 2024-11-24 22:49:35 +01:00
Doc Doc: Rename code documentation files back to Doc 2018-12-14 02:03:42 +01:00
event_test.c Configuration obstacles made a separate, explicit structure 2024-06-14 23:16:07 +02:00
event.c Loop scheduler tracing options configurable 2024-06-12 09:23:50 +02:00
event.h Callback: bundling event with its target 2024-06-14 23:16:07 +02:00
fib.h FIB walk macros now allow continue from the loop 2023-11-02 14:37:27 +01:00
fletcher16_test.c Fletcher16 test fixed to work at bigendian architectures. 2020-04-05 01:15:26 +02:00
fletcher16.h OSPF: Redesign LSA checksumming 2015-05-01 14:40:56 +02:00
flowspec_test.c Flowspec: Fix IPv6 prefix when offset is not multiple of 8 2024-10-16 21:32:36 +02:00
flowspec.c Flowspec: Fix IPv6 prefix when offset is not multiple of 8 2024-10-16 21:32:36 +02:00
flowspec.h Flowspec: Fix values for true/false operators 2021-05-14 18:44:52 +02:00
hash_test.c Hash test spurious fail fixed 2024-11-25 09:44:00 +01:00
hash.h Spinhash main lock removed 2024-06-26 11:29:12 +02:00
heap_test.c Birdtest: Replace BT_SUCCESS and BT_FAILURE with 1 and 0 2016-11-11 17:43:09 +01:00
heap.h BFD work in progress. 2013-09-16 23:57:40 +02:00
idm.c ID Maps are checking whether their pool is locked 2023-05-11 11:41:01 +02:00
idm.h ID Maps are checking whether their pool is locked 2023-05-11 11:41:01 +02:00
io-loop.h Flush deferred calls directly after the loop finished its one run 2024-06-28 22:03:45 +02:00
ip_test.c Flowspec: Fix IPv6 prefix when offset is not multiple of 8 2024-10-16 21:32:36 +02:00
ip.c Lib: Optimized printing of IP addresses 2024-11-08 18:51:54 +01:00
ip.h Lib: Optimized printing of IP addresses 2024-11-08 18:51:54 +01:00
lists_test.c Lists: Replaced replace_node() by update_node() which is the only use of that function. 2020-05-01 15:19:12 +02:00
lists.c Merge commit '0bb04d5390f21b0c96fc4894ba5d5510c541f0ef' into HEAD 2023-02-07 14:27:23 +01:00
lists.h Merge commit 'b95dc8f29f18eb177f91fdc4bf0716fac9b15366' into mq-config-ref 2024-06-26 17:19:24 +02:00
lockfree.c lockfree.c: Solution for lfjour_cleanup_hook() too often scheduling. This function was scheduled each time any of the journal recipients 2024-12-10 16:32:38 +01:00
lockfree.h lockfree.c: Solution for lfjour_cleanup_hook() too often scheduling. This function was scheduled each time any of the journal recipients 2024-12-10 16:32:38 +01:00
locking_test.c Merge commit 'b95dc8f29f18eb177f91fdc4bf0716fac9b15366' into mq-config-ref 2024-06-26 17:19:24 +02:00
locking.h Forbid locking altogether when RCU reader is active 2024-06-28 22:03:45 +02:00
mac_test.c Lib: Add tests for blake2s and blake2b 2021-06-06 16:28:09 +02:00
mac.c Nest: Allow MAC algorithms to specify min/max key length 2021-06-06 16:28:18 +02:00
mac.h Nest: Allow MAC algorithms to specify min/max key length 2021-06-06 16:28:18 +02:00
macro.h Macro: stringify 2023-02-02 15:57:21 +01:00
Makefile Unit test for RCU 2024-06-04 10:11:36 +02:00
md5.c Add generic message authentication interface 2016-11-02 16:23:53 +01:00
md5.h Add generic message authentication interface 2016-11-02 16:23:53 +01:00
mempool.c Linpool: allocation split to fast and slow 2024-06-26 11:30:41 +02:00
net.c Lib: Optimized printing of IP addresses 2024-11-08 18:51:54 +01:00
net.h Merge commit '38195ac6' into thread-merge-2.16 2024-11-29 10:49:53 +01:00
netindex_private.h Netindex cleanup calls synchronize_rcu() by batches 2024-06-12 14:48:33 +02:00
netindex.c Forbid locking altogether when RCU reader is active 2024-06-28 22:03:45 +02:00
netindex.h Dropped net_resolve_index from feeder fast path 2024-06-12 14:48:33 +02:00
obstacle.h Configuration obstacles made a separate, explicit structure 2024-06-14 23:16:07 +02:00
patmatch_test.c Birdtest: Replace BT_SUCCESS and BT_FAILURE with 1 and 0 2016-11-11 17:43:09 +01:00
patmatch.c Some consts for function arguments 2015-11-24 13:52:26 +01:00
printf_test.c Merge commit '460321cfe979459e3b78ba87694f29865d321612' into thread-next 2024-12-03 15:45:25 +01:00
printf.c Formatting numbers with order prefixes 2024-11-29 16:06:07 +01:00
rcu_test.c Merge commit 'b95dc8f29f18eb177f91fdc4bf0716fac9b15366' into mq-config-ref 2024-06-26 17:19:24 +02:00
rcu.c Forbid locking altogether when RCU reader is active 2024-06-28 22:03:45 +02:00
rcu.h Forbid locking altogether when RCU reader is active 2024-06-28 22:03:45 +02:00
resource.c Simplified temporary resources 2024-05-25 19:37:16 +02:00
resource.h Merge commit '2d6fb31c' into thread-merge-2.16 2024-11-28 09:07:23 +01:00
resource.sgml Fixes for the programmer's manual. 2000-06-08 12:37:21 +00:00
route.h Merge commit '08571b20' into thread-merge-2.16 2024-11-28 08:22:06 +01:00
settle.h Fixed various build problems on FreeBSD and/or CLang 2023-01-20 18:31:57 +01:00
sha1.c Add generic message authentication interface 2016-11-02 16:23:53 +01:00
sha1.h Add generic message authentication interface 2016-11-02 16:23:53 +01:00
sha256.c Add generic message authentication interface 2016-11-02 16:23:53 +01:00
sha256.h Add generic message authentication interface 2016-11-02 16:23:53 +01:00
sha512.c Add generic message authentication interface 2016-11-02 16:23:53 +01:00
sha512.h Add generic message authentication interface 2016-11-02 16:23:53 +01:00
slab_test.c Slab allocator can free the blocks without knowing the parent structure 2022-04-06 18:14:08 +02:00
slab.c Slab: can be deleted as a single object 2024-06-04 10:11:36 +02:00
slist_test.c Birdtest: Replace BT_SUCCESS and BT_FAILURE with 1 and 0 2016-11-11 17:43:09 +01:00
slists.c Unit Testing for BIRD 2016-11-09 16:36:34 +01:00
slists.h Temporary integrated OSPF commit. 2014-06-26 11:58:57 +02:00
socket.h Merge commit '8a40bccf' into thread-merge-2.16 2024-11-28 09:36:33 +01:00
string.h Formatting numbers with order prefixes 2024-11-29 16:06:07 +01:00
strtoul.c Conf: Bytestrings with hex: should use the same general format as ones without. 2023-10-06 04:59:47 +02:00
tbf.c Timers: Fix TBF and some last remains 2017-12-07 13:53:42 +01:00
timer.c Merge commit 'acbdc29d' into thread-merge-2.16 2024-11-28 12:18:44 +01:00
timer.h Merge commit 'acbdc29d' into thread-merge-2.16 2024-11-28 12:18:44 +01:00
tlists_test.c Typed lists: added add_after() and unit tests 2023-04-22 20:48:42 +02:00
tlists.h Typed lists: added forgotten #undef 2024-06-27 04:14:38 +02:00
type_test.c Moved route source attribute (RTS_*) to eattrs 2022-05-04 15:39:53 +02:00
type.h Merge commit '1002c35b' into thread-merge-2.16 2024-11-29 10:25:59 +01:00
unaligned.h The MRT protocol 2018-11-20 17:45:35 +01:00
xmalloc.c Tame improper xmalloc warning 2024-06-26 17:21:26 +02:00