From patchwork Fri Oct 12 10:19:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 12184 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 D9BA923FB2 for ; Fri, 12 Oct 2012 10:22:24 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 837D6A18520 for ; Fri, 12 Oct 2012 10:22:24 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so1919559iag.11 for ; Fri, 12 Oct 2012 03:22:24 -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:date:from :to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent:x-gm-message-state; bh=ymz0C27Ghbi4MClxYciZ/l1bJ+6259kZU0BezvQxMLI=; b=j3Z38Ld4/AzQ/SY94jHB4nJBj+AkLOMnNQ/G2tnFNpoygaNMkQrn6nohrrakBQEGUO QIAnvmb9WRQd2EqSQgESyD6PKEVqRD1a8p65IMMqoEUO7lMfRqeu39GzgcLpIAdhYe+w XEJsfOm8gb+oo9sUyQ+mMlO32TnisbXuiD1HZKLC3/JB6OybOLKIzNLk3hjJSIXmV+Jz Y6w37LFPUGUVU+cho1jIz6sqXtOAzU99DN0l5jtbLmpDbNrGJFh6vsD2zrMjnjqvP7S8 8LKBbANMzqxIOf0pWQuk/RevcPUGdn/I+oE3px5JjDbMkU4iMICZfEgg9GzqEWtDlvqK silA== Received: by 10.50.236.72 with SMTP id us8mr1639038igc.70.1350037343927; Fri, 12 Oct 2012 03:22:23 -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.50.67.148 with SMTP id n20csp176340igt; Fri, 12 Oct 2012 03:22:23 -0700 (PDT) Received: by 10.68.135.39 with SMTP id pp7mr12157664pbb.127.1350037343372; Fri, 12 Oct 2012 03:22:23 -0700 (PDT) Received: from mail-da0-f50.google.com (mail-da0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id pm3si10994552pbc.221.2012.10.12.03.22.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 03:22:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.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 mail-da0-f50.google.com with SMTP id z20so1433853dae.37 for ; Fri, 12 Oct 2012 03:22:23 -0700 (PDT) Received: by 10.66.90.65 with SMTP id bu1mr10088356pab.31.1350037342862; Fri, 12 Oct 2012 03:22:22 -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 mz10sm4247368pbc.37.2012.10.12.03.22.21 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 03:22:22 -0700 (PDT) Date: Fri, 12 Oct 2012 03:19:32 -0700 From: Anton Vorontsov To: Pekka Enberg Cc: Leonid Moiseichuk , 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] mm: vmevent: Report number of used swap pages, not total amount of swap Message-ID: <20121012101932.GA30179@lizard> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQka/789dCvTlilqvm2jjHIpxPbqVvqkRPNCWuZvmfRF/+K36knfQgbkyyZXMnXnVYGiK/Ro 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 --- 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