aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/vty
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-07-28 11:57:51 +0200
committerlaforge <laforge@osmocom.org>2020-08-10 14:11:18 +0000
commiteb6882fa5249c1f4fd764f4339ff7d749e1cfb99 (patch)
treeebde0bec33713ff53472316c2f88dac308bf9b7a /include/osmocom/vty
parent7dbae9ea40e2855729f9efa7264b5af78af779db (diff)
vty: Introduce support to set cpu-affinity and scheduler policy
Process willing to support this kind of configuration through VTY simply need to call "osmo_sched_vty_init(tall_ctx);" during startup to register the commands. For multithreaded processes, new threads willing to get their cpu-affinity mask according to VTY config should call osmo_sched_vty_apply_localthread() (potentially after setting the thread name through pthread_setname_np()). Related: SYS#4986 Change-Id: If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Diffstat (limited to 'include/osmocom/vty')
-rw-r--r--include/osmocom/vty/command.h1
-rw-r--r--include/osmocom/vty/cpu_sched_vty.h37
2 files changed, 38 insertions, 0 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index 29206ceb..e3692dc8 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -97,6 +97,7 @@ enum node_type {
L_CS7_SCCPADDR_NODE, /*!< SS7 SCCP Address */
L_CS7_SCCPADDR_GT_NODE, /*!< SS7 SCCP Global Title */
+ L_CPU_SCHED_NODE, /*!< CPU Sched related options node */
/*
* When adding new nodes to the libosmocore project, these nodes can be
* used to avoid ABI changes for unrelated projects.
diff --git a/include/osmocom/vty/cpu_sched_vty.h b/include/osmocom/vty/cpu_sched_vty.h
new file mode 100644
index 00000000..171f1687
--- /dev/null
+++ b/include/osmocom/vty/cpu_sched_vty.h
@@ -0,0 +1,37 @@
+/*! \file cpu_sched_vty.h
+ * API to CPU / Threading / Scheduler properties from VTY configuration.
+ */
+/* (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * Author: Pau Espin Pedrol <pespin@sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#pragma once
+
+#include <osmocom/vty/command.h>
+
+/*! \defgroup cpu_sched_VTY Configuration
+ * @{
+ * \file cpu_sched_vty.h
+ */
+
+void osmo_cpu_sched_vty_init(void *tall_ctx);
+int osmo_cpu_sched_vty_apply_localthread(void);
+
+/*! @} */