[PATCH 3/5] vmevent: Refresh vmstats before sampling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On SMP, kernel updates vmstats only once per second, which makes vmevent
unusable. Let's fix it by updating vmstats before sampling.

Reported-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxx>
Signed-off-by: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx>
---
 mm/vmevent.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/vmevent.c b/mm/vmevent.c
index 4ca2a04..35fd0d5 100644
--- a/mm/vmevent.c
+++ b/mm/vmevent.c
@@ -2,6 +2,7 @@
 #include <linux/atomic.h>
 #include <linux/compiler.h>
 #include <linux/vmevent.h>
+#include <linux/mm.h>
 #include <linux/syscalls.h>
 #include <linux/workqueue.h>
 #include <linux/file.h>
@@ -163,6 +164,9 @@ static void vmevent_sample(struct vmevent_watch *watch)
 
 	if (atomic_read(&watch->pending))
 		return;
+
+	refresh_vm_stats();
+
 	if (!vmevent_match(watch))
 		return;
 
-- 
1.7.9.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]