From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx205.postini.com [74.125.245.205]) by kanga.kvack.org (Postfix) with SMTP id D5D2A6B0044 for ; Fri, 12 Oct 2012 06:22:23 -0400 (EDT) Received: by mail-pa0-f41.google.com with SMTP id fa10so2997951pad.14 for ; Fri, 12 Oct 2012 03:22:23 -0700 (PDT) Date: Fri, 12 Oct 2012 03:19:32 -0700 From: Anton Vorontsov 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-Type: text/plain; charset=utf-8 Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: 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 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 -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422692Ab2JLKWY (ORCPT ); Fri, 12 Oct 2012 06:22:24 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:37519 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422665Ab2JLKWX (ORCPT ); Fri, 12 Oct 2012 06:22:23 -0400 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-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 1.7.12.1