Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35741?usp=email )
Change subject: BSSGP_Emulation: expect altstep timeout entry only if timer is running
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35741?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id7d1b76a6bc1fc2f0f4896c59673c01293b526e9
Gerrit-Change-Number: 35741
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 30 Jan 2024 14:28:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
jolly has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35672?usp=email )
Change subject: Prevent poll() in select.c to timeout too early
......................................................................
Prevent poll() in select.c to timeout too early
Adjust osmo_timers_nearest_ms() to round up the remaining time.
Note that poll() has a granularity of 1 millisecond.
Previously, when rounding down the remaining time, osmo_select_main()
would return too early, before the nearest timer timed out.
Consequently, the main loop repeatedly called osmo_select_main() until
the timer actually timed out, resulting in excessive CPU usage.
By modifying osmo_timers_nearest_ms() to round up the remaining time,
we ensure accurate timeout calculations, preventing unnecessary CPU
consumption during the main loop.
The patch only applies to non-embedded version of libosmocore, because
the impact on embedded systems is not verified tested.
Related: OS#6339
Change-Id: I79de77c79af4d50d1eb9ca0c5417123ff760dca3
---
M src/core/timer.c
1 file changed, 34 insertions(+), 0 deletions(-)
Approvals:
Hoernchen: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/core/timer.c b/src/core/timer.c
index 20d87a0..067bd87 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -191,7 +191,16 @@
return -1;
nearest_ms = nearest_p->tv_sec * 1000;
+#ifndef EMBEDDED
+ /* By adding 999 milliseconds, we ensure rounding up to the nearest
+ * whole millisecond. This approach prevents the return of 0 when the
+ * timer is still active, and it guarantees that the calling process
+ * does not wait for a duration shorter than the time remaining on the
+ * timer. */
+ nearest_ms += (nearest_p->tv_usec + 999) / 1000;
+#else
nearest_ms += nearest_p->tv_usec / 1000;
+#endif
return nearest_ms;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35672?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I79de77c79af4d50d1eb9ca0c5417123ff760dca3
Gerrit-Change-Number: 35672
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: Hoernchen, fixeria, jolly, laforge, pespin.
Hello Hoernchen, Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/35672?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by pespin, Code-Review+2 by Hoernchen, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: Prevent poll() in select.c to timeout too early
......................................................................
Prevent poll() in select.c to timeout too early
Adjust osmo_timers_nearest_ms() to round up the remaining time.
Note that poll() has a granularity of 1 millisecond.
Previously, when rounding down the remaining time, osmo_select_main()
would return too early, before the nearest timer timed out.
Consequently, the main loop repeatedly called osmo_select_main() until
the timer actually timed out, resulting in excessive CPU usage.
By modifying osmo_timers_nearest_ms() to round up the remaining time,
we ensure accurate timeout calculations, preventing unnecessary CPU
consumption during the main loop.
The patch only applies to non-embedded version of libosmocore, because
the impact on embedded systems is not verified tested.
Related: OS#6339
Change-Id: I79de77c79af4d50d1eb9ca0c5417123ff760dca3
---
M src/core/timer.c
1 file changed, 34 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/35672/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35672?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I79de77c79af4d50d1eb9ca0c5417123ff760dca3
Gerrit-Change-Number: 35672
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35740?usp=email )
Change subject: mobile: set TRAFFIC.{ind,req} mode during call establishment
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35740?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iab68cb47c28380a9c1efc149c6196ea54f75fdb8
Gerrit-Change-Number: 35740
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 30 Jan 2024 09:39:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment