finished the LaTeX script

This commit is contained in:
paul-loedige 2022-12-16 00:40:30 +09:00
parent 4c4a0b1c61
commit a128c8ae63
6 changed files with 158 additions and 2 deletions

2
.gitignore vendored
View File

@ -23,7 +23,7 @@
# *.pdf # *.pdf
## Generated if empty string is given at "Please type another file name for output:" ## Generated if empty string is given at "Please type another file name for output:"
.pdf *.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber): ## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl *.bbl

View File

@ -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}

BIN
LaTeX/with_rt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
LaTeX/without_rt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

65
output.txt Normal file
View File

@ -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

View File

@ -1,7 +1,8 @@
#!/bin/bash
echo "==================================================" >> output.txt echo "==================================================" >> output.txt
uname -a >> output.txt uname -a >> output.txt
echo "--------------------------------------------------" >> output.txt echo "--------------------------------------------------" >> output.txt
hackbench -l 20000 >> output.txt & hackbench -l 40000 >> output.txt &
sleep 1 sleep 1
echo "--------------------------------------------------" >> output.txt echo "--------------------------------------------------" >> output.txt
sudo cyclictest -q --mlockall --smp --priority=80 --interval=200 --distance=0 -D 1m >> output.txt sudo cyclictest -q --mlockall --smp --priority=80 --interval=200 --distance=0 -D 1m >> output.txt