summaryrefslogtreecommitdiff
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2013-04-29 15:06:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 15:54:28 -0700
commitfe0bfaaff84429a35e4447d4ccd646aecf5999fb (patch)
treeed27f6c218ab9256d5bf30f6a4a28285c8f2c992 /mm/filemap.c
parente39862958d54e4cccec01f5cdef3ae298e7386b8 (diff)
downloadlinux-3.10-fe0bfaaff84429a35e4447d4ccd646aecf5999fb.tar.gz
linux-3.10-fe0bfaaff84429a35e4447d4ccd646aecf5999fb.tar.bz2
linux-3.10-fe0bfaaff84429a35e4447d4ccd646aecf5999fb.zip
mm: trace filemap add and del
Use the events API to trace filemap loading and unloading of file pieces into the page cache. This patch aims at tracing the eviction reload cycle of executable and shared libraries pages in a memory constrained environment. The typical usage is to spot a specific device and inode (for example /lib/libc.so) to see the eviction cycles, and find out if frequently used code is rather spread across many pages (bad) or coallesced (good). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Dave Chinner <david@fromorbit.com> Cc: Hugh Dickins <hughd@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index e1979fdca80..2581826409f 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -35,6 +35,9 @@
#include <linux/cleancache.h>
#include "internal.h"
+#define CREATE_TRACE_POINTS
+#include <trace/events/filemap.h>
+
/*
* FIXME: remove all knowledge of the buffer layer from the core VM
*/
@@ -113,6 +116,7 @@ void __delete_from_page_cache(struct page *page)
{
struct address_space *mapping = page->mapping;
+ trace_mm_filemap_delete_from_page_cache(page);
/*
* if we're uptodate, flush out into the cleancache, otherwise
* invalidate any existing cleancache entries. We can't leave
@@ -464,6 +468,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
mapping->nrpages++;
__inc_zone_page_state(page, NR_FILE_PAGES);
spin_unlock_irq(&mapping->tree_lock);
+ trace_mm_filemap_add_to_page_cache(page);
} else {
page->mapping = NULL;
/* Leave page->index set: truncation relies upon it */