From 419ee2957e35830d4726b329307cfae6de274dde Mon Sep 17 00:00:00 2001
From: Jan Altenberg <jan@linutronix.de>
Date: Tue, 25 Jan 2011 15:37:04 +0100
Subject: linux-processes: Added CPU affinity and resource limits

---
 .../linux-processes/pres_linux-processes_en.tex    | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

(limited to 'linux-basics/linux-processes/pres_linux-processes_en.tex')

diff --git a/linux-basics/linux-processes/pres_linux-processes_en.tex b/linux-basics/linux-processes/pres_linux-processes_en.tex
index 73582d8..142ab50 100644
--- a/linux-basics/linux-processes/pres_linux-processes_en.tex
+++ b/linux-basics/linux-processes/pres_linux-processes_en.tex
@@ -193,6 +193,30 @@ Scheduling policies:
 \end{verbatim}
 \end{frame}
 
+\begin{frame}[fragile]
+\frametitle{Setting scheduling class and priority}
+\begin{lstlisting}
+#include <sched.h>
+
+struct sched_param param;
+int ret;
+
+params.prio = 80;
+ret = sched_setscheduler(0, SCHED_FIFO, &param);
+[...]
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Resource limits}
+\begin{lstlisting}
+#include <sys/resource.h>
+
+int setrlimit(int resource,
+           const struct rlimit *rlim);
+\end{lstlisting}
+\end{frame}
+
 \section{Daemons}
 \begin{frame}
 \frametitle{Daemons}
@@ -214,6 +238,38 @@ working directory and so on...)
 \end{itemize}
 \end{frame}
 
+\begin{frame}[fragile]
+\frametitle{Scheduling on Multicore Systems}
+\begin{itemize}
+\item CPU affinity
+\item Kernelparameters:
+\begin{itemize}
+\item num\_cpus=
+\item isolcpus=
+\item cpuset=
+\end{itemize}
+\end{itemize}
+\end{frame}
+
+\section{Multicore specific scheduling}
+\begin{frame}[fragile]
+\frametitle{CPU affinity}
+\begin{lstlisting}
+#define _GNU_SOURCE
+#include <sched.h>
+
+cpu_set_t set;
+
+CPU_ZERO(&set);
+CPU_SET(0, &set);
+CPU_SET(1, &set);
+
+[...]
+
+sched_setaffinity(pid, CPU_SETSIZE, &set);
+\end{lstlisting}
+\end{frame}
+
 \section*{sources}
 \begin{frame}
 \begin{thebibliography}{1}
-- 
cgit v1.2.3

