# Differences

This shows you the differences between two versions of the page.

gheorghe.petre2608 [03. [30p] Kernel Samepage Merging]
radu.mantu [03. [30p] Kernel Samepage Merging]
Line 7: Line 7:
=== [15p] Task A - Check kernel support & enable ksmd === === [15p] Task A - Check kernel support & enable ksmd ===

-First things first, you need to verify that KSM was enabled during your kernel'​s compilation. For this, you need to check the Linux make config ​build file that is stored on your /boot partition. Hopefully, you should see something like this:+First things first, you need to verify that KSM was enabled during your kernel'​s compilation. For this, you need to check the Linux build configuration ​file. Hopefully, you should see something like this:

<code bash> <code bash>
+# on Ubuntu you can usually find it in your /boot partition
$grep CONFIG_KSM /​boot/​config-$(uname -r) $grep CONFIG_KSM /​boot/​config-$(uname -r)
+CONFIG_KSM=y
+
+# otherwise, you can find a gzip compressed copy in /proc
+\$ zcat /​proc/​config.gz | grep CONFIG_KSM
CONFIG_KSM=y CONFIG_KSM=y
</​code>​ </​code>​
Line 43: Line 48:
Finally, look at the provided code, compile it, and launch the program. As an argument you will need to provide the number of pages that will be allocated and initialized with the same value. Note that not all pages will be de-duplicated instantly. So keep in mind your system'​s RAM limitations before deciding how much you can spare (1-2GB should be ok, right?) Finally, look at the provided code, compile it, and launch the program. As an argument you will need to provide the number of pages that will be allocated and initialized with the same value. Note that not all pages will be de-duplicated instantly. So keep in mind your system'​s RAM limitations before deciding how much you can spare (1-2GB should be ok, right?)

-The result should look something like this: +The result should look something like **Figure 1**:
- +
-<​spoiler>​ +