From 3b03c4b2bcbcf5a913a3127d2b45283540c505c3 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 2 Apr 2018 08:19:54 +0200 Subject: ipcpd: Enable locking threads to a CPU core This adds a function that locks a thread to a random core. This greatly improves performance on multi-cpu systems. There is no portable way to do this, this only implements it for GNU/Linux. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/sdu_sched.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/normal') diff --git a/src/ipcpd/normal/sdu_sched.c b/src/ipcpd/normal/sdu_sched.c index d4826ce5..56455721 100644 --- a/src/ipcpd/normal/sdu_sched.c +++ b/src/ipcpd/normal/sdu_sched.c @@ -20,12 +20,13 @@ * Foundation, Inc., http://www.fsf.org/about/contact/. */ -#define _POSIX_C_SOURCE 199309L +#define _POSIX_C_SOURCE 200112L #include "config.h" #include +#include "ipcp.h" #include "sdu_sched.h" #include @@ -67,6 +68,8 @@ static void * sdu_reader(void * o) sched = ((struct sched_info *) o)->sch; qc = ((struct sched_info *) o)->qc; + ipcp_lock_to_core(); + free(o); fq = fqueue_create(); -- cgit v1.2.3