1
00:00:06,559 --> 00:00:09,880
An important part of the Linux
kernel is a proc val system.

2
00:00:10,500 --> 00:00:15,710
This is a so called pseudo file system
that provides access to kernel settings and parameters.

3
00:00:16,789 --> 00:00:20,344
And it's nice that you have
it because it allows an easy

4
00:00:20,344 --> 00:00:23,899
interface to see what is
going on and to tweak parameters.

5
00:00:24,739 --> 00:00:27,670
In this file system you will
find three main types of files.

6
00:00:28,390 --> 00:00:33,420
There are status files like procmem info which
give detailed insight in parts of the kernel.

7
00:00:34,179 --> 00:00:38,795
There is proc sys, which contains kernel
tunables, and proc pid which is a

8
00:00:38,795 --> 00:00:43,409
directory structure that has detailed information
about processes that are running on Linux.

9
00:00:43,950 --> 00:00:44,530
Let's have
a look.

10
00:00:45,850 --> 00:00:50,523
So LSPROC is giving me all of
this and if I want to see

11
00:00:50,523 --> 00:00:55,196
what is really going on in hardware
on my system, I can query the

12
00:00:55,196 --> 00:00:59,869
files in here. So I'm using
less on proc meminfo for instance.

13
00:01:00,429 --> 00:01:06,625
And there we see deep going insight into the
way how memory is used in Linux. Now this requires

14
00:01:06,625 --> 00:01:12,819
a specialized course by itself, but it's good to
know all the level of detail that is easily accessible.

15
00:01:13,519 --> 00:01:20,400
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.

16
00:01:21,129 --> 00:01:27,680
In proxys you have different subdirectories that relate
to all the interfaces that the kernel is offering.

17
00:01:28,280 --> 00:01:34,575
And one of these subdirectories is vm.
VM relates to virtual memory, and virtual memory

18
00:01:34,575 --> 00:01:40,870
in Linux terminology is the totality of
memory that your Linux system is using.

19
00:01:41,810 --> 00:01:47,450
Now what I would like to show you here is
how it works and let's talk about the swappiness parameter.

20
00:01:48,319 --> 00:01:54,935
I use CAT on swappiness and there we can
see it has the value of 30. The swappiness

21
00:01:54,935 --> 00:02:01,550
parameter contains a value between 0 and 100 that
indicates how eager your kernel is to start swapping.

22
00:02:02,109 --> 00:02:06,826
If it runs low on memory, a
value closer to 100 means that it will

23
00:02:06,826 --> 00:02:11,543
start swapping faster. So if I don't
like the 30 and I want it to

24
00:02:11,543 --> 00:02:16,259
start swapping faster, I can echo
my new value into the swappiness parameter.

25
00:02:17,080 --> 00:02:21,900
This is the only way how you
can change the parameters. And that's because this

26
00:02:21,900 --> 00:02:26,719
proc vale system is a kind of
a fake file system. It's not really something

27
00:02:26,719 --> 00:02:31,539
that exists on disk. It's an interface
to your kernel and different rules apply.

28
00:02:32,419 --> 00:02:35,180
Final thing is
the PID directories.

29
00:02:35,840 --> 00:02:40,564
So every process has its own PID
directory. And if I want to know

30
00:02:40,564 --> 00:02:45,289
what is going on for process 606
then I can check its PID directory.

31
00:02:46,250 --> 00:02:50,090
Most important file to figure out
what is going on is CMD line.

32
00:02:50,629 --> 00:02:55,204
And there I can see that. Oh, this
PID doesn't have a CMD line. That means

33
00:02:55,204 --> 00:02:59,779
that it's a kernel process. That's not
really something that I would like to do.

34
00:02:59,840 --> 00:03:04,055
So let me give it
another try and go to 949cat

35
00:03:04,055 --> 00:03:08,270
cmd line is showing that
this is the udiskd program.

36
00:03:09,580 --> 00:03:13,194
If I want to know what
is going on in this udiskd program,

37
00:03:13,194 --> 00:03:16,810
the most important file that I
can find is the status file.

38
00:03:17,550 --> 00:03:22,539
This status file is giving detailed information
about all that your process is doing.

39
00:03:23,259 --> 00:03:28,905
Now, this proc VAL system is not something that you
are going to use on a daily basis, but I wanted

40
00:03:28,905 --> 00:03:34,550
to tell you about it because it's a very rich
interface that is giving insight into what your kernel is doing.
