An important part of the Linux kernel is a proc val system.
This is a so called pseudo file system that provides access to kernel settings and parameters.
And it's nice that you have it because it allows an easy
interface to see what is going on and to tweak parameters.
In this file system you will find three main types of files.
There are status files like procmem info which give detailed insight in parts of the kernel.
There is proc sys, which contains kernel tunables, and proc pid which is a
directory structure that has detailed information about processes that are running on Linux.
Let's have a look.
So LSPROC is giving me all of this and if I want to see
what is really going on in hardware on my system, I can query the
files in here. So I'm using less on proc meminfo for instance.
And there we see deep going insight into the way how memory is used in Linux. Now this requires
a specialized course by itself, but it's good to know all the level of detail that is easily accessible.
I also like proc sys, and before I'm going there I'm opening a root shell that makes working with a little bit more convenient.
In proxys you have different subdirectories that relate to all the interfaces that the kernel is offering.
And one of these subdirectories is vm. VM relates to virtual memory, and virtual memory
in Linux terminology is the totality of memory that your Linux system is using.
Now what I would like to show you here is how it works and let's talk about the swappiness parameter.
I use CAT on swappiness and there we can see it has the value of 30. The swappiness
parameter contains a value between 0 and 100 that indicates how eager your kernel is to start swapping.
If it runs low on memory, a value closer to 100 means that it will
start swapping faster. So if I don't like the 30 and I want it to
start swapping faster, I can echo my new value into the swappiness parameter.
This is the only way how you can change the parameters. And that's because this
proc vale system is a kind of a fake file system. It's not really something
that exists on disk. It's an interface to your kernel and different rules apply.
Final thing is the PID directories.
So every process has its own PID directory. And if I want to know
what is going on for process 606 then I can check its PID directory.
Most important file to figure out what is going on is CMD line.
And there I can see that. Oh, this PID doesn't have a CMD line. That means
that it's a kernel process. That's not really something that I would like to do.
So let me give it another try and go to 949cat
cmd line is showing that this is the udiskd program.
If I want to know what is going on in this udiskd program,
the most important file that I can find is the status file.
This status file is giving detailed information about all that your process is doing.
Now, this proc VAL system is not something that you are going to use on a daily basis, but I wanted
to tell you about it because it's a very rich interface that is giving insight into what your kernel is doing.