Active Memory Deduplication
nagger 100000MRSJ Comment (1) Visits (10656)
Active Memory Deduplication was announcement on 12th October and available on 14th October but there has been a little confusion on: what you need, how you install it and run it and how it works? This blog will attempt to demystify this interesting new Power Systems feature. This is one of many features to reduce the memory foot print and so reduce costs for POWER and AIX logical partitions. So far we have:
The unfortunate shorten name based on its initials = AMD is not a good idea for very obvious reasons, so I have been calling the DeDup but that can be confused to disk space de-duplication, which is a current hot topic in storage circles. So I have spelt it out in full in this blog.
In the Redbook, it has the following pre-requisite information:
A) The Firmware level 740 is only available on the "new" October 2011 POWER7 model machines which is becoming known as the "C" machines" as they all have a C in the model name - like MMC. This means the older but current POWER7 machines which are running Firmware Level 720 or (recommended) 730 do not run Active Memory Deduplication.
B) To run Active Memory Deduplication the memory involved must be in a Active Memory Sharing pool (AMS) and adding the Deduplication is a new option of AMS. Reminder: in AMS memory is placed in a pool and all AMS virtual machines (LPARs) draw memory pages from the pool. If the memory allocated to the VMs adds up to the pool size every VM gets enough memory. If memory is over subscribed then the VMs compete on a demand basis for memory pages. Memory pages are loaned in a cooperating mode between VMs. But when memory is very short supply pages are stolen by the hypervisor after they are paged out by the VIOS to its special purpose AMS paging devices and then given to a the VM more demanding pages. To use AMS the virtual machines have to be pure virtual i.e. no physical adapters but using virtual Ethernet and virtual disks.
C) AMS is a feature of the Hypervisor and VIOS. But Active Memory Deduplication is just a feature of the Hypervisor. So you need a current level of VIOS for AMS to be supported but not a particular level for Active Memory Deduplication. The new POWER7 machine only support VIOS 2.2 - so you may as well install the latest VIOS version.
D) Also note the new HMC version is required so that you have access to the new panels to switch on Active Memory Deduplication. You do this when you create your Active Memory Sharing pool and then add or change VM's to use this shared memory pool. I am told SDMC will catch up with this new feature in its next update in 2012.
You can read the Redbook for some more information on how Active Memory Deduplication works but here is a summary.
The Hypervisor in the back ground - actually "stealing CPU cycles" from the the VIOS but running hypervisor code and not the VIOS itself - and looks through the AMS memory pages and taking a fingerprint of each. We all know about a sum check which can be computationally very hard work on the CPU it would give you a large number which is extremely likely to be unique in the order of billions to 1. A fingerprint is a light weight version using a sample of bytes from the page and uses a tiny fraction of the CPU time but only say a million to 1 chance of being unique. The hypervisor then keeps an in-memory cache of the finger prints. Each time is creates a fingerprint, it then compares that with the cache and if a duplicate is found it then has to perform a full byte to byte check of the memory page with the one in the cache to be absolutely certain they are identical. If they are identical, one pages can go on the free list and the virtual memory map updated so it has the remaining memory page now has two references to it. This multiple references to a common memory page is completely normal operation within a single operating system but this is a new use as this is across operating systems.
If one operating system or program tries to update any common temporarily marked as read-only de-duplicated pages then a separate copy of the page has to be made before the write - a technique called COW = Copy On Write and again a common technique in operating systems.
Once you have AMS set-up and the new HMC level, you will have a further option to Enable Active Memory Deduplication when you set the AMS Pool Size and Maximum Pool Size. Then all the virtual machines (LPARs) using the Active Memory Sharing pool now also benefit from Active Memory Deduplication. It will setup a default size for the Active Memory Deduplication cache - this can be changed using HMC command line (lshwres and chhwres commands) - it is not expected that users will need to tune the cache size. The size is expressed as a ratio for example: 1:1024 so roughly one thousandth of memory is used.
Also on the HMC you can get information about the Shared Memory Pool use and the individual virtual machine use of the memory pool. This can be done on the HMC GUI or via the lslparutil command.
My list of pages that are good de-duplication targets are:
If anyone has experience - please share what you find out here - particularly the amounts of memory saved with particular applications.