From: Rafael Aquini <aquini@redhat.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Rusty Russell <rusty@rustcorp.com.au>,
"Michael S. Tsirkin" <mst@redhat.com>,
Rik van Riel <riel@redhat.com>, Mel Gorman <mel@csn.ul.ie>,
Andi Kleen <andi@firstfloor.org>,
Andrew Morton <akpm@linux-foundation.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Minchan Kim <minchan@kernel.org>,
Rafael Aquini <aquini@redhat.com>
Subject: [PATCH v7 4/4] mm: add vm event counters for balloon pages compaction
Date: Fri, 10 Aug 2012 14:55:17 -0300 [thread overview]
Message-ID: <f7dbe40a97ed7af3bb7281ca1f7e4107ea2460d7.1344619987.git.aquini@redhat.com> (raw)
In-Reply-To: <cover.1344619987.git.aquini@redhat.com>
In-Reply-To: <cover.1344619987.git.aquini@redhat.com>
This patch introduces a new set of vm event counters to keep track of
ballooned pages compaction activity.
Signed-off-by: Rafael Aquini <aquini@redhat.com>
---
drivers/virtio/virtio_balloon.c | 1 +
include/linux/vm_event_item.h | 8 +++++++-
mm/compaction.c | 2 ++
mm/migrate.c | 1 +
mm/vmstat.c | 10 +++++++++-
5 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 7c937a0..b8f7ea5 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -414,6 +414,7 @@ int virtballoon_migratepage(struct address_space *mapping,
mutex_unlock(&balloon_lock);
+ count_vm_event(COMPACTBALLOONMIGRATED);
return 0;
}
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 57f7b10..b1841a2 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -41,7 +41,13 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
#ifdef CONFIG_COMPACTION
COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED,
COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
-#endif
+#if defined(CONFIG_VIRTIO_BALLOON) || defined(CONFIG_VIRTIO_BALLOON_MODULE)
+ COMPACTBALLOONISOLATED, /* isolated from balloon pagelist */
+ COMPACTBALLOONMIGRATED, /* balloon page sucessfully migrated */
+ COMPACTBALLOONRETURNED, /* putback to pagelist, not-migrated */
+ COMPACTBALLOONRELEASED, /* old-page released after migration */
+#endif /* CONFIG_VIRTIO_BALLOON || CONFIG_VIRTIO_BALLOON_MODULE */
+#endif /* CONFIG_COMPACTION */
#ifdef CONFIG_HUGETLB_PAGE
HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
#endif
diff --git a/mm/compaction.c b/mm/compaction.c
index 8567bb8..ff0f9ac 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -77,6 +77,7 @@ bool isolate_balloon_page(struct page *page)
(page_count(page) == 2)) {
__isolate_balloon_page(page);
unlock_page(page);
+ count_vm_event(COMPACTBALLOONISOLATED);
return true;
}
unlock_page(page);
@@ -97,6 +98,7 @@ void putback_balloon_page(struct page *page)
__putback_balloon_page(page);
put_page(page);
unlock_page(page);
+ count_vm_event(COMPACTBALLOONRETURNED);
}
#endif /* CONFIG_VIRTIO_BALLOON || CONFIG_VIRTIO_BALLOON_MODULE */
diff --git a/mm/migrate.c b/mm/migrate.c
index 1165134..024566f 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -892,6 +892,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
page_is_file_cache(page));
put_page(page);
__free_page(page);
+ count_vm_event(COMPACTBALLOONRELEASED);
return rc;
}
out:
diff --git a/mm/vmstat.c b/mm/vmstat.c
index df7a674..ad5c4f1 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -768,7 +768,15 @@ const char * const vmstat_text[] = {
"compact_stall",
"compact_fail",
"compact_success",
-#endif
+
+#if defined(CONFIG_VIRTIO_BALLOON) || defined(CONFIG_VIRTIO_BALLOON_MODULE)
+ "compact_balloon_isolated",
+ "compact_balloon_migrated",
+ "compact_balloon_returned",
+ "compact_balloon_released",
+#endif /* CONFIG_VIRTIO_BALLOON || CONFIG_VIRTIO_BALLOON_MODULE */
+
+#endif /* CONFIG_COMPACTION */
#ifdef CONFIG_HUGETLB_PAGE
"htlb_buddy_alloc_success",
--
1.7.11.2
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-08-10 17:55 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 17:55 [PATCH v7 0/4] make balloon pages movable by compaction Rafael Aquini
2012-08-10 17:55 ` [PATCH v7 1/4] mm: introduce compaction and migration for virtio ballooned pages Rafael Aquini
2012-08-12 23:14 ` Minchan Kim
2012-08-13 8:26 ` Michael S. Tsirkin
2012-08-14 17:44 ` Rafael Aquini
2012-08-14 19:35 ` Michael S. Tsirkin
2012-08-14 19:48 ` Michael S. Tsirkin
2012-08-14 20:03 ` Rafael Aquini
2012-08-14 20:00 ` Rafael Aquini
2012-08-14 20:23 ` Michael S. Tsirkin
2012-08-15 8:52 ` Mel Gorman
2012-08-14 19:52 ` Michael S. Tsirkin
2012-08-10 17:55 ` [PATCH v7 2/4] virtio_balloon: introduce migration primitives to balloon pages Rafael Aquini
2012-08-13 8:41 ` Michael S. Tsirkin
2012-08-13 23:59 ` Rusty Russell
2012-08-14 8:33 ` Michael S. Tsirkin
2012-08-14 18:44 ` Rafael Aquini
2012-08-14 19:31 ` Michael S. Tsirkin
2012-08-15 12:34 ` Rafael Aquini
2012-08-15 14:40 ` Michael S. Tsirkin
2012-08-20 2:29 ` Rusty Russell
2012-08-20 5:12 ` Michael S. Tsirkin
2012-08-15 3:13 ` Rusty Russell
2012-08-14 18:22 ` Rafael Aquini
2012-08-14 19:51 ` Michael S. Tsirkin
2012-08-14 19:59 ` Michael S. Tsirkin
2012-08-14 20:08 ` Rafael Aquini
2012-08-14 20:24 ` Michael S. Tsirkin
2012-08-14 20:29 ` Rafael Aquini
2012-08-14 20:49 ` Michael S. Tsirkin
2012-08-14 20:54 ` Michael S. Tsirkin
2012-08-14 20:56 ` Rik van Riel
2012-08-14 21:38 ` Michael S. Tsirkin
2012-08-15 15:30 ` Rik van Riel
2012-08-14 21:34 ` Rafael Aquini
2012-08-14 22:48 ` Michael S. Tsirkin
2012-08-14 20:11 ` Rafael Aquini
2012-08-14 20:31 ` Michael S. Tsirkin
2012-08-15 9:05 ` Mel Gorman
2012-08-15 9:25 ` Michael S. Tsirkin
2012-08-15 9:48 ` Mel Gorman
2012-08-15 10:01 ` Michael S. Tsirkin
2012-08-15 11:16 ` Mel Gorman
2012-08-15 11:28 ` Michael S. Tsirkin
2012-08-21 5:31 ` Rusty Russell
2012-08-22 0:37 ` Michael S. Tsirkin
2012-08-10 17:55 ` [PATCH v7 3/4] mm: introduce putback_movable_pages() Rafael Aquini
2012-08-12 23:26 ` Minchan Kim
2012-08-10 17:55 ` Rafael Aquini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7dbe40a97ed7af3bb7281ca1f7e4107ea2460d7.1344619987.git.aquini@redhat.com \
--to=aquini@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan@kernel.org \
--cc=mst@redhat.com \
--cc=riel@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).