From e33be771e4d9e5a88119f4e3af6259e01257c8a5 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 11 Jul 2021 14:01:15 +0200 Subject: ipcpd: Reduce Linux slack timer This will reduce the linux high resolution slack timer in IPCPs. Linux default for userspace processes is 50us. It is configurable at build using IPCP_LINUX_SLACKTIMER_NS. Default is now 1us. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/ipcp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ipcpd/ipcp.c') diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 59fbdba6..ab2f88f8 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #if defined(__linux__) && !defined(DISABLE_CORE_LOCK) #include @@ -710,6 +711,9 @@ int ipcp_init(int argc, ipcpi.state = IPCP_NULL; ipcpi.type = type; +#if defined (__linux__) + prctl(PR_SET_TIMERSLACK, IPCP_LINUX_SLACK_NS, 0, 0, 0); +#endif ipcpi.sock_path = ipcp_sock_path(getpid()); if (ipcpi.sock_path == NULL) goto fail_sock_path; -- cgit v1.2.3