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

Message ID 20121012101932.GA30179@lizard
State New
Headers show

Commit Message

Anton Vorontsov Oct. 12, 2012, 10:19 a.m.
I think the actual intent was to report the number of used swap pages, not
just total swap size.

This patch fixes the issue.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
---
 mm/vmevent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/vmevent.c b/mm/vmevent.c
index 1c2e72e..a059bed 100644
--- a/mm/vmevent.c
+++ b/mm/vmevent.c
@@ -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