diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-03-13 17:57:42 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-03-15 10:45:13 +0100 |
commit | a4fd6d937151c2f321533d20f78c052caa9b6bf1 (patch) | |
tree | eb896a31184a91161115ad8214399d9322f815ae /tests | |
parent | 08a7db6cd3c9b09bc566c7536d2b73972d8679a8 (diff) |
bsc_subscriber: Optimize lookup of bsub by TMSI
It was found that on a busy osmo-bsc process (>1000 concurrent calls
spead over different BTSs), a good amount of time is spent iterating the
subscribers list trying to find a subscriber based on a TMSI (1.60% of
total CPU time used by osmo-bsc).
This patch introduces a new rbtree under struct bsc_subscr_store which
allows storing all the busbs ordered by TMSI.
This way, lookup time changes O(N) -> O(log(N)), at the expense of
increased insert/deletion time O(1) -> O(log(N)).
Related: SYS#6200
Change-Id: If27429e715ef4b327177e427249e68321a6e83cc
Diffstat (limited to 'tests')
-rw-r--r-- | tests/subscr/bsc_subscr_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/subscr/bsc_subscr_test.c b/tests/subscr/bsc_subscr_test.c index 27dc93e1d..2a0e1eb0c 100644 --- a/tests/subscr/bsc_subscr_test.c +++ b/tests/subscr/bsc_subscr_test.c @@ -75,7 +75,7 @@ static void test_bsc_subscr(void) /* Allocate entry 2 */ s2 = bsc_subscr_find_or_create_by_imsi(bsc_subscribers, imsi2, BSUB_USE); - s2->tmsi = 0x73517351; + bsc_subscr_set_tmsi(s2, 0x73517351); VERBOSE_ASSERT(llist_count(&bsc_subscribers->bsub_list), == 2, "%d"); /* Allocate entry 3 */ |