lkml.org 
[lkml]   [2011]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] Capture references to page cache pages
Date
Hi,

Page cache accesses may not be mapped, hence fake an access when a
pagecache page is looked up, by marking the corresponding memory
address block as accessed.

Signed-off-by: Ankita Garg <ankita@in.ibm.com>
---
mm/filemap.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index a8251a8..7ae7f36 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -36,6 +36,7 @@
#include <linux/mm_inline.h> /* for page_is_file_cache() */
#include <linux/cleancache.h>
#include "internal.h"
+#include <linux/memtrace.h>

/*
* FIXME: remove all knowledge of the buffer layer from the core VM
@@ -730,6 +731,13 @@ repeat:
page_cache_release(page);
goto repeat;
}
+#if defined(CONFIG_MEMTRACE)
+ if(get_pg_trace_pid() != -1 && current->mem_trace) {
+ unsigned long pfn = page_to_pfn(page);
+ if(pfn_valid(pfn))
+ mark_memtrace_block_accessed(pfn << PAGE_SHIFT);
+ }
+#endif
}
out:
rcu_read_unlock();
--
1.7.4


\
 
 \ /
  Last update: 2011-07-05 10:27    [W:1.649 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site