Blame SOURCES/procps-ng-3.3.8-free-shmem.patch

2006ba
diff --git a/free.1 b/free.1
2006ba
index f7c2313..1e8e7ef 100644
2006ba
--- a/free.1
2006ba
+++ b/free.1
2006ba
@@ -11,8 +11,11 @@ free \- Display amount of free and used memory in the system
2006ba
 .SH DESCRIPTION
2006ba
 .B free
2006ba
 displays the total amount of free and used physical and swap memory in the
2006ba
-system, as well as the buffers used by the kernel.  The shared memory column
2006ba
-should be ignored; it is obsolete.
2006ba
+system, as well as the buffers used by the kernel.
2006ba
+The shared memory column represents either the MemShared value (2.4 series
2006ba
+kernels) or the Shmem value (2.6 series kernels and later) taken from the
2006ba
+/proc/meminfo file. The value is zero if none of the entries is exported
2006ba
+by the kernel.
2006ba
 .SH OPTIONS
2006ba
 .TP
2006ba
 \fB\-b\fR, \fB\-\-bytes\fR
2006ba
diff --git a/proc/sysinfo.c b/proc/sysinfo.c
2006ba
index 15cdb83..8e4aca2 100644
2006ba
--- a/proc/sysinfo.c
2006ba
+++ b/proc/sysinfo.c
2006ba
@@ -629,13 +629,14 @@ void meminfo(void){
2006ba
   {"LowTotal",     &kb_low_total},
2006ba
   {"Mapped",       &kb_mapped},       // kB version of vmstat nr_mapped
2006ba
   {"MemFree",      &kb_main_free},    // important
2006ba
-  {"MemShared",    &kb_main_shared},  // important, but now gone!
2006ba
+  {"MemShared",    &kb_main_shared},  // obsolete since kernel 2.6! (sharing the variable with Shmem replacement)
2006ba
   {"MemTotal",     &kb_main_total},   // important
2006ba
   {"NFS_Unstable", &kb_nfs_unstable},
2006ba
   {"PageTables",   &kb_pagetables},   // kB version of vmstat nr_page_table_pages
2006ba
   {"ReverseMaps",  &nr_reversemaps},  // same as vmstat nr_page_table_pages
2006ba
   {"SReclaimable", &kb_swap_reclaimable}, // "swap reclaimable" (dentry and inode structures)
2006ba
   {"SUnreclaim",   &kb_swap_unreclaimable},
2006ba
+  {"Shmem",        &kb_main_shared},  // sharing the output variable with obsolete MemShared (kernel 2.6 and later)
2006ba
   {"Slab",         &kb_slab},         // kB version of vmstat nr_slab
2006ba
   {"SwapCached",   &kb_swap_cached},
2006ba
   {"SwapFree",     &kb_swap_free},    // important