pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41990?usp=email )
Change subject: logging_file: Request up to 8 iofd write buffers if available ......................................................................
logging_file: Request up to 8 iofd write buffers if available
This should help in decreasing latency between submitting a logging line and getting it written to file. It should, for the same reason, optimize CPU use.
Change-Id: Ia88b27948922d278e0f72fc2aac4b4ae88465b4d --- M src/core/logging_file.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/41990/1
diff --git a/src/core/logging_file.c b/src/core/logging_file.c index 9c7cf36..067f993 100644 --- a/src/core/logging_file.c +++ b/src/core/logging_file.c @@ -253,6 +253,10 @@ _log_target_file_setup_talloc_pool(target); osmo_iofd_set_txqueue_max_length(iofd, OSMO_MAX(osmo_iofd_get_txqueue_max_length(iofd), LOG_WQUEUE_LEN));
+ /* Request to use 8 write buffers, or less if not as many are available: */ + rc = osmo_iofd_set_io_buffers(iofd, OSMO_IO_OP_WRITE, 0); + rc = osmo_iofd_set_io_buffers(iofd, OSMO_IO_OP_WRITE, OSMO_MIN(rc, 8)); + rc = osmo_iofd_register(iofd, -1); if (rc < 0) { osmo_iofd_free(iofd);