Skip to content

Instantly share code, notes, and snippets.

@ubunteroz
Created February 5, 2015 07:06
Show Gist options
  • Save ubunteroz/a3eafdf8e11ce81c73c6 to your computer and use it in GitHub Desktop.
Save ubunteroz/a3eafdf8e11ce81c73c6 to your computer and use it in GitHub Desktop.
Simple UKSM Monitor
#!/bin/bash
while true
do
clear
PSHARING=$(cat /sys/kernel/mm/uksm/pages_sharing)
PSHARED=$(cat /sys/kernel/mm/uksm/pages_shared)
PUNSHARED=$(cat /sys/kernel/mm/uksm/pages_unshared)
echo -en "Simple UKSM Monitor\n\n"
echo -n "Shared pool size (KB) : "
echo "$PSHARED*4" | bc
echo -n "Efficiency : "
echo "scale=3;($PSHARING/$PSHARED)" | bc
echo -n "Wasted effort : "
echo "scale=3;($PUNSHARED/$PSHARING)" | bc
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment