diff --git a/.gitignore b/.gitignore index 697edcb..b4508a3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ # *.pdf ## Generated if empty string is given at "Please type another file name for output:" -.pdf +*.pdf ## Bibliography auxiliary files (bibtex/biblatex/biber): *.bbl diff --git a/LaTeX/Homework_Lesson_10.tex b/LaTeX/Homework_Lesson_10.tex new file mode 100644 index 0000000..fe30162 --- /dev/null +++ b/LaTeX/Homework_Lesson_10.tex @@ -0,0 +1,90 @@ +\documentclass[a4paper, 12pt, english]{article} + +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{listings} +\usepackage{xcolor} +\usepackage{hyperref} +\usepackage{multicol} +\usepackage{setspace} +\usepackage{graphicx} + + +\title{Advanced Operating Systems\\Assignment Week 10} +\author{Paul Lödige \\ Student ID: 37-229753} + +\makeatletter +\newcommand*{\toccontents}{\@starttoc{toc}} +\makeatother + +\begin{document} +\maketitle +\toccontents + +\section{Assignment}% +\label{sec:Assignment} +Create a user-space program (any language is acceptable) +that differentiates the performance of the Linux Kernel with the PREEMPT\_ RT patches from that without the PREEMPT\_ RT patches. +Compile and run the program. +Submit the source code and the screen shots of the standard output and the kernel log message, respectively, when the program is being executed. +\clearpage + +\section{Code}% +\label{sec:Code} + +\definecolor{mGreen}{rgb}{0,0.6,0} +\definecolor{mGray}{rgb}{0.5,0.5,0.5} +\definecolor{mPurple}{rgb}{0.58,0,0.82} +\definecolor{backgroundColour}{rgb}{0.95,0.95,0.92} +\lstset{ + language=bash, + backgroundcolor=\color{backgroundColour}, + commentstyle=\color{mGreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{mGray}, + stringstyle=\color{mPurple}, + basicstyle=\ttfamily\scriptsize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + firstnumber=0, + stepnumber=1, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2, + literate={~}{{$\mathtt{\sim}$}}1 +} +\lstset{literate=% + {Ö}{{\"O}}1 + {Ä}{{\"A}}1 + {Ü}{{\"U}}1 + {ß}{{\ss}}2 + {ü}{{\"u}}1 + {ä}{{\"a}}1 + {ö}{{\"o}}1 +} + +The following code is just a shell script that makes use of two programs provided by the \texttt{rt-tests} package (Arch Linux). +It uses the \texttt{hackbench} program to put stress on the system and then evaluates the maximum latency with the \texttt{cyclictest} program. +This provides a much more reliable method of testing the real-time capabilites of the system than any self-developed code I was able to come up with. +\lstinputlisting{../test.sh} +The code is based on the following two sources:\\ +\url{https://wiki.archlinux.org/title/Realtime_kernel_patchset}\\ +\url{https://shuhaowu.com/blog/2022/02-linux-rt-appdev-part2.html} + +\section{Output}% +\label{sec:Output} + +\subsection{with PREEMPT\_RT}% +\label{sub:with PREEMPT RT} +\includegraphics[width = \textwidth]{with_rt.png} + +\subsection{without PREEMPT\_RT}% +\label{sub:without PREEMPT RT} +\includegraphics[width = \textwidth]{without_rt.png} + +\end{document} diff --git a/LaTeX/with_rt.png b/LaTeX/with_rt.png new file mode 100644 index 0000000..6420e7d Binary files /dev/null and b/LaTeX/with_rt.png differ diff --git a/LaTeX/without_rt.png b/LaTeX/without_rt.png new file mode 100644 index 0000000..5db72b9 Binary files /dev/null and b/LaTeX/without_rt.png differ diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..388187b --- /dev/null +++ b/output.txt @@ -0,0 +1,65 @@ +================================================== +Linux advancedoperatingsystemsvm 6.0.5-2-rt14-MANJARO #1 SMP PREEMPT_RT Sun Nov 6 15:25:56 CET 2022 x86_64 GNU/Linux +-------------------------------------------------- +Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +Each sender will pass 20000 messages of 100 bytes +-------------------------------------------------- +# /dev/cpu_dma_latency set to 0us +T: 0 (18229) P:80 I:200 C: 298471 Min: 3 Act: 66 Avg: 44 Max: 1060 +T: 1 (18230) P:80 I:200 C: 298210 Min: 3 Act: 15 Avg: 29 Max: 1078 +T: 2 (18231) P:80 I:200 C: 298354 Min: 3 Act: 28 Avg: 29 Max: 1051 +T: 3 (18232) P:80 I:200 C: 298247 Min: 3 Act: 43 Avg: 29 Max: 1046 +-------------------------------------------------- +Time: 77.677 +================================================== +Linux advancedoperatingsystemsvm 6.0.11-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Dec 2 21:23:52 UTC 2022 x86_64 GNU/Linux +-------------------------------------------------- +Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +Each sender will pass 20000 messages of 100 bytes +-------------------------------------------------- +Time: 42.581 +# /dev/cpu_dma_latency set to 0us +T: 0 ( 2830) P:80 I:200 C: 297326 Min: 2 Act: 127 Avg: 38 Max: 2452 +T: 1 ( 2831) P:80 I:200 C: 297489 Min: 1 Act: 34 Avg: 52 Max: 2376 +T: 2 ( 2832) P:80 I:200 C: 297665 Min: 2 Act: 29 Avg: 33 Max: 2446 +T: 3 ( 2833) P:80 I:200 C: 297447 Min: 2 Act: 10 Avg: 32 Max: 2350 +-------------------------------------------------- +================================================== +Linux advancedoperatingsystemsvm 6.0.11-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Dec 2 21:23:52 UTC 2022 x86_64 GNU/Linux +-------------------------------------------------- +Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +Each sender will pass 30000 messages of 100 bytes +-------------------------------------------------- +Time: 54.930 +# /dev/cpu_dma_latency set to 0us +T: 0 ( 6073) P:80 I:200 C: 297385 Min: 2 Act: 30 Avg: 30 Max: 1762 +T: 1 ( 6076) P:80 I:200 C: 297132 Min: 2 Act: 37 Avg: 34 Max: 1790 +T: 2 ( 6078) P:80 I:200 C: 296288 Min: 2 Act: 22 Avg: 27 Max: 1759 +T: 3 ( 6082) P:80 I:200 C: 297397 Min: 2 Act: 20 Avg: 50 Max: 1742 +-------------------------------------------------- +================================================== +Linux advancedoperatingsystemsvm 6.0.11-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Dec 2 21:23:52 UTC 2022 x86_64 GNU/Linux +-------------------------------------------------- +Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +Each sender will pass 40000 messages of 100 bytes +-------------------------------------------------- +# /dev/cpu_dma_latency set to 0us +T: 0 ( 2846) P:80 I:200 C: 297642 Min: 3 Act: 8 Avg: 41 Max: 34750 +T: 1 ( 2847) P:80 I:200 C: 297348 Min: 3 Act: 17 Avg: 35 Max: 34712 +T: 2 ( 2848) P:80 I:200 C: 297864 Min: 3 Act: 58 Avg: 60 Max: 34786 +T: 3 ( 2849) P:80 I:200 C: 298013 Min: 3 Act: 50 Avg: 35 Max: 34711 +-------------------------------------------------- +Time: 89.334 +================================================== +Linux advancedoperatingsystemsvm 6.0.5-2-rt14-MANJARO #1 SMP PREEMPT_RT Sun Nov 6 15:25:56 CET 2022 x86_64 GNU/Linux +-------------------------------------------------- +Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +Each sender will pass 40000 messages of 100 bytes +-------------------------------------------------- +# /dev/cpu_dma_latency set to 0us +T: 0 ( 2872) P:80 I:200 C: 297927 Min: 2 Act: 51 Avg: 37 Max: 1756 +T: 1 ( 2873) P:80 I:200 C: 297834 Min: 2 Act: 29 Avg: 37 Max: 1726 +T: 2 ( 2874) P:80 I:200 C: 297550 Min: 3 Act: 31 Avg: 47 Max: 1815 +T: 3 ( 2875) P:80 I:200 C: 297519 Min: 3 Act: 34 Avg: 30 Max: 1743 +-------------------------------------------------- +Time: 153.851 diff --git a/test.sh b/test.sh index aa897ec..586fb9a 100644 --- a/test.sh +++ b/test.sh @@ -1,7 +1,8 @@ +#!/bin/bash echo "==================================================" >> output.txt uname -a >> output.txt echo "--------------------------------------------------" >> output.txt -hackbench -l 20000 >> output.txt & +hackbench -l 40000 >> output.txt & sleep 1 echo "--------------------------------------------------" >> output.txt sudo cyclictest -q --mlockall --smp --priority=80 --interval=200 --distance=0 -D 1m >> output.txt