Differences

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

Link to this comparison view

ep:labs:04:contents:tasks:ex3 [2026/03/23 23:47]
maria.popescu2812 [03. [30p] Kernel Samepage Merging]
ep:labs:04:contents:tasks:ex3 [2026/04/02 13:56] (current)
radu.mantu
Line 2: Line 2:
  
 [[https://​www.kernel.org/​doc/​html/​latest/​admin-guide/​mm/​ksm.html|KSM]] is a page de-duplication strategy introduced in kernel version 2.6.32. In case you are wondering, it's not the same thing as the file page cache. KSM was originally developed in tandem with KVM in order to detect data pages with //exactly// the same content and make their page table entries point to the same physical address (marked Copy-On-Write.) The end goal was to allow more VMs to run on the same host. Since each page must be scanned for identical content, this solution had no chance of scaling well with the available quantity of RAM. So, the developers compromised to scan only with the private anonymous pages that were marked as likely candidates via ''​madvise(addr,​ length, MADV_MERGEABLE)''​. [[https://​www.kernel.org/​doc/​html/​latest/​admin-guide/​mm/​ksm.html|KSM]] is a page de-duplication strategy introduced in kernel version 2.6.32. In case you are wondering, it's not the same thing as the file page cache. KSM was originally developed in tandem with KVM in order to detect data pages with //exactly// the same content and make their page table entries point to the same physical address (marked Copy-On-Write.) The end goal was to allow more VMs to run on the same host. Since each page must be scanned for identical content, this solution had no chance of scaling well with the available quantity of RAM. So, the developers compromised to scan only with the private anonymous pages that were marked as likely candidates via ''​madvise(addr,​ length, MADV_MERGEABLE)''​.
- 
-Download the {{:​ep:​labs:​02:​contents:​tasks:​ksm.zip|skeleton}} for this task. 
  
 === [10p] Task A - Check kernel support & enable ksmd === === [10p] Task A - Check kernel support & enable ksmd ===
Line 61: Line 59:
  
 === [10p] Task C - Plot results === === [10p] Task C - Plot results ===
-Now that you’ve observed the effects of KSM using vmstat, it’s time to visualize them. Solve the TOOs from [[https://​github.com/​cs-pub-ro/​EP-labs/​blob/​master/​content/​memory/​Task03/​ksm/​plot.py|here]] ​to generate a real-time plot that shows free memory, used memory, and memory used as a buffer over time, based on the freemem column from the output of the vmstat command. +Now that you’ve observed the effects of KSM using vmstat, it’s time to visualize them. Solve the TODOs from plot.py ​from skeleton ​to generate a real-time plot that shows free memory, used memory, and memory used as a buffer over time, based on the freemem column from the output of the vmstat command.
- +
  
 +<note tip>
 +**Troubleshooting**
 +-----
 +If you get something resembling ''​Could not load the Qt platform plugin "​xcb"​ in ""​ even though it was found.''​ on either WSL or certain Linux environments (e.g., having Hyprland as a Wayland compositor),​ check out
 +[[https://​blinq.hashnode.dev/​fixing-xcb-load-failures-in-pyqt5-on-windows-subsystem-for-linux-wsl|this post]].
 +</​note>​
ep/labs/04/contents/tasks/ex3.1774302442.txt.gz · Last modified: 2026/03/23 23:47 by maria.popescu2812
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0