Change in osmo-bsc[master]: hodec 2: favor moving dyn TS

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Nov 20 08:56:33 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/21204 )

Change subject: hodec 2: favor moving dyn TS
......................................................................

hodec 2: favor moving dyn TS

When a used timeslot gets moved to another timeslot for load balancing, prefer
moving a dynamic timeslot, as illustrated by handover_test.c test 30.

Rationale: freeing up a dynamic timeslot is better for PDCH availability, as
well as for flexibility in timeslots. Test 30 shows that when freeing a static
TCH/F even though a dynamic one with identical ratings is in use, later
handovers to a TCH/H may become impossible, because no more dynamic timeslots
are available to switch to TCH/H. A freed dynamic timeslot allows congestion
resolution to continue and reduce more TCH/F to TCH/H.

The scope of this preference is per-TRX, where the RXLEV ratings used for
picking a target lchan are the same by definition. In other words, this never
overrules picking another lchan that has better RXLEV.

Among lchans on dynamic timeslots that could be moved, this code favors moving
later lchans; mainly because it makes for a simpler condition in the code.

Change-Id: Ic221b8d2687cdec0bf94410c84a4da43853f0900
---
M src/osmo-bsc/handover_decision_2.c
M tests/handover/handover_test.c
2 files changed, 16 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 7df8bb1..4e54368 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1362,6 +1362,12 @@
 	}
 }
 
+static bool lchan_is_on_dynamic_ts(struct gsm_lchan *lchan)
+{
+	return lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH
+		|| lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH;
+}
+
 /* Given two candidates, pick the one that should rather be moved during handover.
  * Return the better candidate in out-parameters best_cand and best_avg_db.
  */
@@ -1377,6 +1383,12 @@
 	if (!want_highest_db && (*best_avg_db_p > other_avg_db))
 		goto return_other;
 
+	/* The two lchans have identical ratings, prefer picking a dynamic timeslot: free PDCH and allow more timeslot
+	 * type flexibility for further congestion resolution. If both are dynamic, it does not matter which one is
+	 * picked. */
+	if (lchan_is_on_dynamic_ts(other_cand->lchan))
+		goto return_other;
+
 	/* keep the same candidate. */
 	return;
 
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 6befc5a..804ff4b 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1679,16 +1679,15 @@
 	"congestion-check",
 	"expect-chan", "0", "6",
 	"ack-chan",
-	/* Not so good: rather than moving static TCH/F, we should favor freeing dyn TS, for more PDCH */
-	"expect-ho", "0", "1",
+	"expect-ho", "0", "5",
 	"ho-complete",
-	"expect-ts-use", "0", "0", "*", "-", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H-", "PDCH",
+	"expect-ts-use", "0", "0", "*", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "PDCH", "TCH/H-", "PDCH",
 	"congestion-check",
 	"expect-chan", "0", "6",
 	"ack-chan",
-	"expect-ho", "0", "2",
+	"expect-ho", "0", "4",
 	"ho-complete",
-	"expect-ts-use", "0", "0", "*", "-", "-", "TCH/F", "TCH/F", "TCH/F", "TCH/HH", "PDCH",
+	"expect-ts-use", "0", "0", "*", "TCH/F", "TCH/F", "TCH/F", "PDCH", "PDCH", "TCH/HH", "PDCH",
 	"congestion-check",
 	"expect-no-chan",
 	NULL

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21204
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic221b8d2687cdec0bf94410c84a4da43853f0900
Gerrit-Change-Number: 21204
Gerrit-PatchSet: 6
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201120/c298d8b5/attachment.htm>


More information about the gerrit-log mailing list