KSMState - file /sys/kernel/mm/ksm/run

Parser to get the kernel samepage merging state by reading the file /sys/kernel/mm/ksm/run.

class insights.parsers.ksmstate.KSMState(context)[source]

Bases: Parser

Parser to get the kernel samepage merging state by reading the file /sys/kernel/mm/ksm/run.

Typical output of /sys/kernel/mm/ksm/run likes:

0

From https://www.kernel.org/doc/Documentation/vm/ksm.txt:

set 0 to stop ksmd from running but keep merged pages,
set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run",
set 2 to stop ksmd and unmerge all pages currently merged, but leave
      mergeable areas registered for next run

Examples

>>> ksm.value == '0'
True
>>> ksm.is_running
False
Raises:
parse_content(content)[source]

This method must be implemented by classes based on this class.