On 20.06.24 06:39, Sung-hun Kim wrote:
The current version of KSM does not take into account the number of
used ksm_mm_slot. Therefore, when users want to obtain profits of
KSM, KSM omits the memory used for allocating ksm_mm_slots.
This patch introduces a new variable to keep track of the number of
allocated ksm_mm_slots. By doing so, KSM will be able to provide a
more accurate number of the gains made.
If you take a look at the calculation explained in Documentation/admin-guide/mm/ksm.rst, we only care about rmap_items, which can grow rather substantially in size.
We also don't consider other metadata, such as the size of the stable nodes etc. So why should the ksm_mm_slots matter that much that we should track them and account them?