From patchwork Fri Jun 1 12:24:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9077 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0229A23E1B for ; Fri, 1 Jun 2012 12:26:34 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id C61C5A1831F for ; Fri, 1 Jun 2012 12:26:33 +0000 (UTC) Received: by yenq6 with SMTP id q6so1884140yen.11 for ; Fri, 01 Jun 2012 05:26:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=MNBIVD1E93wv+67Ia22GtSP2H+uCsqtLR/ABec3srRI=; b=ZOjkyMenGZoiQmg7anOIq+x6KLpGGMZc5+sVCfJF1tvRDh4LcmmJmxXJZBatkopefj uoKnBsImJ4pSzsCYkAcWWX19fRCFOzrP3m43Yahp0ASNUwxJWb5HLwE7090GGCtgchNV I9xirXyMXHNreuWjc4FzCmBGqqeap9KIstsJjIMLaFFhAABjEAubzQcsuM2Y9yU3WKDU nHpHlK41XcyvDBds5i2BBS1AgFmIfRab26aCH/p4QU8MrKC2lSqfnVeaJAsUSWOODmtB u4heG64jwo6KM0Tal5R/Gj4ddca1HyF9s/fPulkxm1D9S/jxnBs9CcSkSAOVogubuiD0 DucA== Received: by 10.50.87.227 with SMTP id bb3mr1155514igb.57.1338553593167; Fri, 01 Jun 2012 05:26:33 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp313880ibb; Fri, 1 Jun 2012 05:26:32 -0700 (PDT) Received: by 10.68.138.166 with SMTP id qr6mr9931728pbb.43.1338553592414; Fri, 01 Jun 2012 05:26:32 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ql5si4305197pbc.156.2012.06.01.05.26.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jun 2012 05:26:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by pbbrr4 with SMTP id rr4so3360451pbb.37 for ; Fri, 01 Jun 2012 05:26:32 -0700 (PDT) Received: by 10.68.190.131 with SMTP id gq3mr10093887pbc.17.1338553592051; Fri, 01 Jun 2012 05:26:32 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id gh10sm631586pbc.19.2012.06.01.05.26.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jun 2012 05:26:31 -0700 (PDT) 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> X-Gm-Message-State: ALoCoQkZrqbChb8ePTp4/WN9DQ8zStI1p6SD9Efmv6IRHq2lZaWHLx+wWw3Zza8OGPMrpDlVbVOW 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;