Skip to contentSkip to conversation

mm: vmevent: Report number of used swap pages, not total amount of swap

PATCH New Anton Vorontsov 1 participant 1 message Oct 12, 2012 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: vmevent: Report number of used swap pages, not total amount of swap

I think the actual intent was to report the number of used swap pages, not just total swap size.

This patch fixes the issue.

---
 mm/vmevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmevent.c +1 -1
index 1c2e72e..a059bed 100644
@@ -46,7 +46,7 @@ static u64 vmevent_attr_swap_pages(struct vmevent_watch *watch,
 
 	si_swapinfo(&si);
 
-	return si.totalswap;
+	return si.totalswap - si.freeswap;
 #else
 	return 0;
 #endif
Signature · 7 lines
1.7.12.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>