Re: [RFC PATCH] LTTng instrumentation mm (using page_to_pfn)

Mathieu Desnoyers
2007-11-29T02:34:35Z

I am adding the rest.. two questions left :

* Dave Hansen (haveblue@us.ibm.com) wrote:

> >
> > Index: linux-2.6-lttng/mm/memory.c
> > ===================================================================
> > --- linux-2.6-lttng.orig/mm/memory.c 2007-11-28 08:42:09.000000000 -0500
> > +++ linux-2.6-lttng/mm/memory.c 2007-11-28 09:02:57.000000000 -0500
> > @@ -2072,6 +2072,7 @@ static int do_swap_page(struct mm_struct
> > delayacct_set_flag(DELAYACCT_PF_SWAPIN);
> > page = lookup_swap_cache(entry);
> > if (!page) {
> > + trace_mark(mm_swap_in, "pfn %lu", page_to_pfn(page));
> > grab_swap_token(); /* Contend for token _before_ read-in */
> > swapin_readahead(entry, address, vma);
> > page = read_swap_cache_async(entry, vma, address);
>
> How about putting the swap file number and the offset as well?
>
[...]
> > Index: linux-2.6-lttng/mm/page_io.c
> > ===================================================================
> > --- linux-2.6-lttng.orig/mm/page_io.c 2007-11-28 08:38:47.000000000 -0500
> > +++ linux-2.6-lttng/mm/page_io.c 2007-11-28 08:52:14.000000000 -0500
> > @@ -114,6 +114,7 @@ int swap_writepage(struct page *page, st
> > rw |= (1 << BIO_RW_SYNC);
> > count_vm_event(PSWPOUT);
> > set_page_writeback(page);
> > + trace_mark(mm_swap_out, "pfn %lu", page_to_pfn(page));
> > unlock_page(page);
> > submit_bio(rw, bio);
>
> I'd also like to see the swap file number and the location in swap for
> this one.
>

Before I start digging deeper in checking whether it is already
instrumented by the fs instrumentation (and would therefore be
redundant), is there a particular data structure from mm/ that you
suggest taking the swap file number and location in swap from ?

Mathieu

> -- Dave