From: a-tsuji@bk.jp.nec.com (Atsushi Tsuji)
Subject: [ltt-dev] [PATCH] Add tracepoints to track pagecache transition
Date: Wed, 04 Feb 2009 10:07:45 +0900 [thread overview]
Message-ID: <4988EA61.60508@bk.jp.nec.com> (raw)
In-Reply-To: <20090203141646.GD9620@Krystal>
Mathieu Desnoyers wrote:
> * Mathieu Desnoyers (compudj at krystal.dyndns.org) wrote:
>> * Atsushi Tsuji (a-tsuji at bk.jp.nec.com) wrote:
>>> Hi,
>>>
>>> I thought it would be useful to trace pagecache behavior for problem
>>> analysis (performance bottlenecks, behavior differences between stable
>>> time and trouble time).
>>>
>>> By using those tracepoints, we can describe and visualize pagecache
>>> transition (file-by-file basis) in kernel and pagecache
>>> consumes most of the memory in running system and pagecache hit rate
>>> and writeback behavior will influence system load and performance.
>>>
>>> I attached an example which is visualization of pagecache status using
>>> SystemTap. That graph describes pagecache transition of File A and File B
>>> on a file-by-file basis with the situation where regular I/O to File A
>>> is delayed because of other I/O to File B. We visually understand
>>> pagecache for File A is narrowed down due to I/O pressure from File B.
>>>
>>> The below patch is for lttng tree to add those new tracepoints.
>>>
>> Hi Atsushi,
>>
>> Great patch !
>>
>> I'll merge it into the next LTTng release.
>>
>
> -EDOESNOTAPPLY
>
> Please make sure your email client is correctly configured and try to
> resend this patch. See Documentation/email-clients.txt for more
> information.
>
Hi Mathieu,
Sorry for wrong patch. I resend fixed one.
Signed-off-by: Atsushi Tsuji <a-tsuji at bk.jp.nec.com>
---
diff --git a/include/trace/filemap.h b/include/trace/filemap.h
index 0d881a1..454d908 100644
--- a/include/trace/filemap.h
+++ b/include/trace/filemap.h
@@ -9,5 +9,11 @@ DECLARE_TRACE(wait_on_page_start,
DECLARE_TRACE(wait_on_page_end,
TPPROTO(struct page *page, int bit_nr),
TPARGS(page, bit_nr));
+DECLARE_TRACE(add_to_page_cache,
+ TPPROTO(struct address_space *mapping, pgoff_t offset),
+ TPARGS(mapping, offset));
+DECLARE_TRACE(remove_from_page_cache,
+ TPPROTO(struct address_space *mapping),
+ TPARGS(mapping));
#endif
diff --git a/ltt/probes/mm-trace.c b/ltt/probes/mm-trace.c
index 2b60d89..b3122c9 100644
--- a/ltt/probes/mm-trace.c
+++ b/ltt/probes/mm-trace.c
@@ -164,6 +164,22 @@ void probe_swap_file_open(struct file *file, char *filename)
}
#endif
+void probe_add_to_page_cache(struct address_space *mapping, pgoff_t offset)
+{
+ trace_mark_tp(mm, add_to_page_cache, add_to_page_cache,
+ probe_add_to_page_cache,
+ "inode %lu sdev %u",
+ mapping->host->i_ino, mapping->host->i_sb->s_dev);
+}
+
+void probe_remove_from_page_cache(struct address_space *mapping)
+{
+ trace_mark_tp(mm, remove_from_page_cache, remove_from_page_cache,
+ probe_remove_from_page_cache,
+ "inode %lu sdev %u",
+ mapping->host->i_ino, mapping->host->i_sb->s_dev);
+}
+
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mathieu Desnoyers");
MODULE_DESCRIPTION("MM Tracepoint Probes");
diff --git a/mm/filemap.c b/mm/filemap.c
index cca96ed..7f3fbcf 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -45,6 +45,8 @@
DEFINE_TRACE(wait_on_page_start);
DEFINE_TRACE(wait_on_page_end);
+DEFINE_TRACE(add_to_page_cache);
+DEFINE_TRACE(remove_from_page_cache);
/*
* Shared mappings implemented 30.11.1994. It's not fully working yet,
@@ -123,6 +125,7 @@ void __remove_from_page_cache(struct page *page)
page->mapping = NULL;
mapping->nrpages--;
__dec_zone_page_state(page, NR_FILE_PAGES);
+ trace_remove_from_page_cache(mapping);
BUG_ON(page_mapped(page));
/*
@@ -477,6 +480,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
if (likely(!error)) {
mapping->nrpages++;
__inc_zone_page_state(page, NR_FILE_PAGES);
+ trace_add_to_page_cache(mapping, offset);
} else {
page->mapping = NULL;
mem_cgroup_uncharge_cache_page(page);
next prev parent reply other threads:[~2009-02-04 1:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 6:08 Atsushi Tsuji
2009-02-03 14:07 ` Mathieu Desnoyers
2009-02-03 14:16 ` Mathieu Desnoyers
2009-02-04 1:07 ` Atsushi Tsuji [this message]
2009-02-04 5:56 ` Mathieu Desnoyers
2009-02-05 0:48 ` Frank Ch. Eigler
2009-02-09 2:54 ` Atsushi Tsuji
2009-02-11 7:18 ` Mathieu Desnoyers
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=4988EA61.60508@bk.jp.nec.com \
--to=a-tsuji@bk.jp.nec.com \
/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