Skip to contentSkip to conversation

Add Inactive to /proc/meminfo was: Mem: and Swap: lines in /proc/meminfo

PATCH Ronny V. Vindenes 3 participants 3 messages Dec 18, 2003 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 32 lines · Mike Fedyk
Quoted 10 lines · Mike Fedyk
Quoted 9 lines · Rik van Riel
Quoted 6 lines · Mike Fedyk
Inact_dirty:     21516 kB
Inact_laundry:   65612 kB
Inact_clean:     19812 kB

These three are seperate lists in rmap, and are equal to "Inactive:" in the -aa vm.

Quoted 7 lines
Quoted 3 lines

I should add an Inactive: list to -rmap that sums up all 3, to make it a bit easier on programs parsing /proc.

ISTR, asking for this a while ago ;)

Yes, please do add that Inactive: line to rmap. :)

How's this patch?

proc_misc.c renamed from proc_misc.c.orig +1 -0
@@ -189,6 +189,7 @@
 		"Active:       %8u kB\n"
 		"ActiveAnon:   %8u kB\n"
 		"ActiveCache:  %8u kB\n"
+		"Inactive:     %8u kB\n"
 		"Inact_dirty:  %8u kB\n"
 		"Inact_laundry:%8u kB\n"
 		"Inact_clean:  %8u kB\n"

proc_misc.c line 212

Quoted 4 lines
proc_misc.c renamed from proc_misc.c.orig +1 -0
@@ -208,6 +209,8 @@
 		K(nr_active_anon_pages()) + K(nr_active_cache_pages()),
 		K(nr_active_anon_pages()),
 		K(nr_active_cache_pages()),
+		K(nr_inactive_dirty_pages()) + K(nr_inactive_dirty_pages())
                              ^^^^^  

Shouldn't that be nr_inactive_clean_pages() ? now it's 2*dirty + laundry

Quoted 5 lines
proc_misc.c renamed from proc_misc.c.orig +1 -1
+			+ K(nr_inactive_laundry_pages()),
 		K(nr_inactive_dirty_pages()),
 		K(nr_inactive_laundry_pages()),
 		K(nr_inactive_clean_pages()),
-
Signature · 1 line
Ronny V. Vindenes <[email protected]>
#4 lore raw
Quoted 5 lines · Ronny V. Vindenes

Review

Quoted 1 line · Mike Fedyk
(quoted diff) +1 -0
+		K(nr_inactive_dirty_pages()) + K(nr_inactive_dirty_pages())
                              ^^^^^  

Shouldn't that be nr_inactive_clean_pages() ? now it's 2*dirty + laundry

Yes, good catch. Thanks

Quoted 1 line

Review

Quoted 1 line
(quoted diff) +1 -0
+			+ K(nr_inactive_laundry_pages()),

How's this?

proc_misc.c renamed from proc_misc.c.orig +3 -0
@@ -189,6 +189,7 @@
 		"Active:       %8u kB\n"
 		"ActiveAnon:   %8u kB\n"
 		"ActiveCache:  %8u kB\n"
+		"Inactive:     %8u kB\n"
 		"Inact_dirty:  %8u kB\n"
 		"Inact_laundry:%8u kB\n"
 		"Inact_clean:  %8u kB\n"
@@ -208,6 +209,8 @@
 		K(nr_active_anon_pages()) + K(nr_active_cache_pages()),
 		K(nr_active_anon_pages()),
 		K(nr_active_cache_pages()),
+		K(nr_inactive_dirty_pages()) + K(nr_inactive_laundry_pages())
+			+ K(nr_inactive_clean_pages()),
 		K(nr_inactive_dirty_pages()),
 		K(nr_inactive_laundry_pages()),
 		K(nr_inactive_clean_pages()),
#5 lore raw
Quoted 1 line · Mike Fedyk

How's this?

Even better than the last one ;)

Good catch, Ronny!

Signature · 3 lines
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan