* watching bloated slabs
@ 2002-07-30 6:28 William Lee Irwin III
0 siblings, 0 replies; only message in thread
From: William Lee Irwin III @ 2002-07-30 6:28 UTC (permalink / raw)
To: linux-mm
[-- Attachment #1: bloated message --]
[-- Type: text/plain, Size: 563 bytes --]
I got to wondering about how bloated various slabs were, and how
perhaps to track their bloatedness over time. So I brewed up a couple
of scripts to help more closely observe their humongous bloatedness.
bloatmon just cooks some slab stats so it grinds out lines with the
cache name, amount of space granted to callers, amount of space parked
in the slab, and percent utilization.
bloatmeter drives bloatmon in a loop, sorts its output by %util, and
chops off the output at 22 lines to put the most underutilized (and
hence bloated) slabs up top.
Cheers,
Bill
[-- Attachment #2: bloatmon --]
[-- Type: text/plain, Size: 413 bytes --]
#!/usr/bin/awk -f
BEGIN {
printf "%18s %8s %8s %8s\n", "cache", "active", "alloc", "%util";
}
{
if ($3 != 0.0) {
pct = 100.0 * $2 / $3;
frac = (10000.0 * $2 / $3) % 100;
} else {
pct = 100.0;
frac = 0.0;
}
active = ($2 * $4)/1024;
alloc = ($3 * $4)/1024;
if ((alloc - active) < 1.0) {
pct = 100.0;
frac = 0.0;
}
printf "%18s: %8dKB %8dKB %3d.%-2d\n", $1, active, alloc, pct, frac;
}
[-- Attachment #3: bloatmeter --]
[-- Type: text/plain, Size: 133 bytes --]
#!/bin/sh
while : ; do
grep -v '^slabinfo' /proc/slabinfo \
| bloatmon \
| sort -n -k 4,4 \
| head -22
sleep 5
echo
done
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-30 6:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-30 6:28 watching bloated slabs William Lee Irwin III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox