Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933007Ab2FAM13 (ORCPT ); Fri, 1 Jun 2012 08:27:29 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:48867 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759600Ab2FAM0c (ORCPT ); Fri, 1 Jun 2012 08:26:32 -0400 From: Anton Vorontsov To: Pekka Enberg Cc: Leonid Moiseichuk , KOSAKI Motohiro , Minchan Kim , Bartlomiej Zolnierkiewicz , John Stultz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH 3/5] vmevent: Refresh vmstats before sampling Date: Fri, 1 Jun 2012 05:24:04 -0700 Message-Id: <1338553446-22292-3-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <20120601122118.GA6128@lizard> References: <20120601122118.GA6128@lizard> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1082 Lines: 39 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 Signed-off-by: Anton Vorontsov --- 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 #include #include +#include #include #include #include @@ -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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/