STATE_FREE,
STATE_BUFFERS,
STATE_CACHED,
- STATE_SLAB_TOTAL,
- STATE_SLAB_RECL,
- STATE_SLAB_UNRECL,
STATE_WIRED,
STATE_ACTIVE,
STATE_INACTIVE,
STATE_LOCKED,
STATE_ARC,
STATE_UNUSED,
- STATE_AVAILABLE,
STATE_USER_WIRE,
STATE_LAUNDRY,
STATE_MAX, /* #states */
} memory_type_t;
static char const *memory_type_names[STATE_MAX] = {
- "used",
- "free",
- "buffers",
- "cached",
- "slab",
- "slab_reclaimable",
- "slab_unreclaimable",
- "wired",
- "active",
- "inactive",
- "kernel",
- "locked",
- "arc",
- "unusable",
- "available",
- "user_wire",
- "laundry",
+ "used", "free", "buffers", "cached", "wired",
+ "active", "inactive", "kernel", "locked", "arc",
+ "unusable", "user_wire", "laundry",
};
/* vm_statistics_data_t */
} else if (strcmp(fields[0], "Cached:") == 0) {
values[STATE_CACHED] = v;
mem_not_used += v;
- } else if (strcmp(fields[0], "Slab:") == 0) {
- values[STATE_SLAB_TOTAL] = v;
- } else if (strcmp(fields[0], "SReclaimable:") == 0) {
- values[STATE_SLAB_RECL] = v;
- } else if (strcmp(fields[0], "SUnreclaim:") == 0) {
- values[STATE_SLAB_UNRECL] = v;
- } else if (strcmp(fields[0], "MemAvailable:") == 0) {
- values[STATE_AVAILABLE] = v;
}
}
WARNING("memory plugin: fclose failed: %s", STRERRNO);
}
- /* If SReclaimable (introduced in kernel 2.6.19) is available count it
- * (but not SUnreclaim) towards the unused memory.
- * If we do not have detailed slab info count the total as unused. */
- if (!isnan(values[STATE_SLAB_RECL])) {
- mem_not_used += values[STATE_SLAB_RECL];
- } else if (!isnan(values[STATE_SLAB_TOTAL])) {
- mem_not_used += values[STATE_SLAB_TOTAL];
- }
-
if (isnan(mem_total) || (mem_total == 0) || (mem_total < mem_not_used)) {
return EINVAL;
}
/* "used" is not explicitly reported. It is calculated as everything that is
* not "not used", e.g. cached, buffers, ... */
values[STATE_USED] = mem_total - mem_not_used;
-
- /* SReclaimable and SUnreclaim were introduced in kernel 2.6.19
- * They sum up to the value of Slab, which is available on older & newer
- * kernels. So SReclaimable/SUnreclaim are submitted if available, and Slab
- * if not. */
- if (!isnan(values[STATE_SLAB_RECL]) || !isnan(values[STATE_SLAB_UNRECL])) {
- values[STATE_SLAB_TOTAL] = NAN;
- }
/* #endif KERNEL_LINUX */
#elif HAVE_LIBKSTAT