aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/bsc/bts.h
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-05-30 02:39:17 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-06-02 14:24:30 +0200
commitc1bfc88b6bbb370207e1dcb70af21bd806867ea2 (patch)
tree0247e7b4bc22c10e604fee4eaf8f592837b38af7 /include/osmocom/bsc/bts.h
parent4c89001ccbd4dfb505454ae2b5f31ac09af7848a (diff)
fix performance for chan_counts and all_allocated stats
The all_allocated_update_bsc() does inefficient iterating to count active/inactive lchans, which scales badly for high numbers of TRX managed by osmo-bsc. We need to update the all_allocated flags immediately (periodic counting alone would suffer from undersampling), so, until now, we are calling this inefficient function every time a channel state changes. Instead of iterating all channels for any chan state changes anywhere, keep global state of the current channel counts, and on channel state change only update those ts, trx, bts counts that actually change. A desirable side effect: for connection stats and handover decision 2, we can now also use the globally updated channel counts and save a bunch of inefficient iterations. To get accurate channel counts at all times, spread around some chan_counts_ts_update() calls in pivotal places. It re-counts the given timeslot and cascades counter changes, iff required. Just in case I missed some channel accounting, still run an inefficient iterating count regularly that detects errors, logs them and fixes them. No real harm done if such error appears. None show in ttcn3 BSC_Tests. It is fine to do the inefficient iteration once per second; channel state changes can realistically happen hundreds of times per second. Related: SYS#5976 Change-Id: I580bfae329aac8d4552723164741536af6512011
Diffstat (limited to 'include/osmocom/bsc/bts.h')
-rw-r--r--include/osmocom/bsc/bts.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index fc3ebce12..66cf68f02 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -637,6 +637,7 @@ struct gsm_bts {
/* At what point in the channel allocation sequence to dispatch the Immediate Assignment (Abis optimization) */
enum imm_ass_time imm_ass_time;
+ struct chan_counts chan_counts;
struct all_allocated all_allocated;
};