linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmevent: Report number of used swap pages, not total amount of swap
@ 2012-10-12 10:19 Anton Vorontsov
  0 siblings, 0 replies; only message in thread
From: Anton Vorontsov @ 2012-10-12 10:19 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Leonid Moiseichuk, Bartlomiej Zolnierkiewicz, John Stultz,
	linux-mm, linux-kernel, linaro-kernel, patches, kernel-team

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(-)

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
-- 
1.7.12.1

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-12 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 10:19 [PATCH] mm: vmevent: Report number of used swap pages, not total amount of swap Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).