libosmocore/src/core
Andreas Eversberg e8f05481ea 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
2024-01-30 12:06:58 +00:00
..
Makefile.am core: Add software UART implementation 2023-11-21 00:58:53 +07:00
application.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
backtrace.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
base64.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
bitcomp.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
bits.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
bitvec.c bitvec: bitvec_to_string_r(): drop unused variable 2024-01-03 09:54:46 +00:00
context.c on_dso_load_select: run after on_dso_load_ctx 2023-03-14 15:22:20 +00:00
conv.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_generic.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_neon.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_neon_impl.h Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_sse.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_sse_avx.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
conv_acc_sse_impl.h Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
counter.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
crc16.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
crcXXgen.c.tpl Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
exec.c exec: osmo_system_nowait2(): Improve logging and error checks 2023-07-25 15:22:14 +00:00
fsm.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
gsmtap_util.c gmstap_util: Fix sending out gsmtap messages 2023-11-17 18:52:58 +01:00
isdnhdlc.c isdndlc: Fix documentation 2023-01-21 22:41:57 +01:00
it_q.c core: fix wrong logic in _osmo_it_q_dequeue() 2023-12-09 15:23:11 +07:00
libosmocore.map Revert "logging: add log level cache" 2024-01-09 16:37:05 +00:00
logging.c Revert "logging: add log level cache" 2024-01-09 16:37:05 +00:00
logging_gsmtap.c logging_gsmtap: Temporarily disable logging when sending the logs 2023-11-09 19:34:37 +07:00
logging_syslog.c Fix all references to config.h 2023-01-18 19:04:36 +01:00
logging_systemd.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
loggingrb.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
macaddr.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
mnl.c doxygen: fix various typos in commands \param and \returns 2023-02-28 18:48:56 +00:00
msgb.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
msgfile.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
netdev.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-19 08:48:48 +00:00
netns.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-19 08:48:48 +00:00
osmo_io.c osmo_io: Factor out and use common send function from backend 2023-11-30 14:27:39 +01:00
osmo_io_internal.h osmo_io: Factor out and use common send function from backend 2023-11-30 14:27:39 +01:00
osmo_io_poll.c osmo_io: Factor out and use common send function from backend 2023-11-30 14:27:39 +01:00
osmo_io_uring.c osmo_io: Factor out and use common send function from backend 2023-11-30 14:27:39 +01:00
panic.c Fix all references to config.h 2023-01-18 19:04:36 +01:00
plugin.c Fix all references to config.h 2023-01-18 19:04:36 +01:00
prbs.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
prim.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
probes.d Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
rate_ctr.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
rbtree.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
select.c select: Prevent negative index lookup on osmo_fd_lookup.table 2023-08-23 17:10:13 +00:00
sercomm.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
serial.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
signal.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
sockaddr_str.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
socket.c socket: Introduce defines OSMO_SOCK_MULTIADDR_{PEER_STR,NAME}_MAXLEN 2023-12-12 14:00:12 +01:00
soft_uart.c soft_uart: fix the Rx flushing logic, add a unit test 2023-12-11 20:49:24 +00:00
stat_item.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
stat_item_internal.h Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
stats.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
stats_statsd.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
stats_tcp.c cosmetic: stats_tcp: Fix typo in comment 2023-03-09 21:18:08 +00:00
strrb.c core: remove unnecessary #include <osmocom/core/talloc.h> 2023-03-31 05:39:24 +07:00
tdef.c core: osmo_tdef_fsm_inst_state_chg(): allow millisecond precision 2024-01-09 13:11:04 +00:00
thread.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
time_cc.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
timer.c Prevent poll() in select.c to timeout too early 2024-01-30 12:06:58 +00:00
timer_clockgettime.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
timer_gettimeofday.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
tun.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-19 08:48:48 +00:00
use_count.c Move src/*.{c,h} to src/core/ 2023-01-18 17:14:06 +01:00
utils.c utils: osmo_bcd2str(): fix applying non-zero offset to null pointer 2024-01-03 09:54:46 +00:00
write_queue.c write_queue: Fix Doxygen comment 2023-10-20 20:55:54 +00:00