linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tao Ma <tm@tao.ma>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mel Gorman <mel@csn.ul.ie>, Rik van Riel <riel@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Christoph Hellwig <hch@infradead.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH V2] vmscan/trace: Add 'active' and 'file' info to trace_mm_vmscan_lru_isolate.
Date: Mon, 12 Dec 2011 09:26:41 +0800	[thread overview]
Message-ID: <4EE55851.7040807@tao.ma> (raw)
In-Reply-To: <CAEwNFnAApCLfnd3AgyEeao4dPT9nwY4CKWDJrXQ9pwiAQcj85Q@mail.gmail.com>

On 12/12/2011 09:23 AM, Minchan Kim wrote:
> On Mon, Dec 12, 2011 at 10:19 AM, Tao Ma <tm@tao.ma> wrote:
>> On 12/12/2011 08:59 AM, Minchan Kim wrote:
>>> Hi Tao,
>>>
>>> On Sun, Dec 11, 2011 at 11:46 PM, Tao Ma <tm@tao.ma> wrote:
>>>> From: Tao Ma <boyu.mt@taobao.com>
>>>>
>>>> In trace_mm_vmscan_lru_isolate, we don't output 'active' and 'file'
>>>> information to the trace event and it is a bit inconvenient for the
>>>> user to get the real information(like pasted below).
>>>> mm_vmscan_lru_isolate: isolate_mode=2 order=0 nr_requested=32 nr_scanned=32
>>>> nr_taken=32 contig_taken=0 contig_dirty=0 contig_failed=0
>>>>
>>>> So this patch adds these 2 info to the trace event and it now looks like:
>>>> mm_vmscan_lru_isolate: isolate_mode=2 order=0 nr_requested=32 nr_scanned=32
>>>> nr_taken=32 contig_taken=0 contig_dirty=0 contig_failed=0 active=1 file=0
>>>>
>>>> Cc: Mel Gorman <mel@csn.ul.ie>
>>>> Cc: Rik van Riel <riel@redhat.com>
>>>> Cc: Johannes Weiner <hannes@cmpxchg.org>
>>>> Cc: Christoph Hellwig <hch@infradead.org>
>>>> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>>> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>>> Signed-off-by: Tao Ma <boyu.mt@taobao.com>
>>>> ---
>>>>  include/trace/events/vmscan.h |   25 +++++++++++++++++--------
>>>>  mm/memcontrol.c               |    2 +-
>>>>  mm/vmscan.c                   |    6 +++---
>>>>  3 files changed, 21 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
>>>> index edc4b3d..82bc49c 100644
>>>> --- a/include/trace/events/vmscan.h
>>>> +++ b/include/trace/events/vmscan.h
>>>> @@ -266,9 +266,10 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
>>>>                unsigned long nr_lumpy_taken,
>>>>                unsigned long nr_lumpy_dirty,
>>>>                unsigned long nr_lumpy_failed,
>>>> -               isolate_mode_t isolate_mode),
>>>> +               isolate_mode_t isolate_mode,
>>>> +               int active, int file),
>>>>
>>>> -       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
>>>> +       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode, active, file),
>>>>
>>>>        TP_STRUCT__entry(
>>>>                __field(int, order)
>>>> @@ -279,6 +280,8 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
>>>>                __field(unsigned long, nr_lumpy_dirty)
>>>>                __field(unsigned long, nr_lumpy_failed)
>>>>                __field(isolate_mode_t, isolate_mode)
>>>> +               __field(int, active)
>>>> +               __field(int, file)
>>>>        ),
>>>>
>>>>        TP_fast_assign(
>>>> @@ -290,9 +293,11 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
>>>>                __entry->nr_lumpy_dirty = nr_lumpy_dirty;
>>>>                __entry->nr_lumpy_failed = nr_lumpy_failed;
>>>>                __entry->isolate_mode = isolate_mode;
>>>> +               __entry->active = active;
>>>> +               __entry->file = file;
>>>>        ),
>>>>
>>>> -       TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu",
>>>> +       TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu active=%d file=%d",
>>>>                __entry->isolate_mode,
>>>>                __entry->order,
>>>>                __entry->nr_requested,
>>>> @@ -300,7 +305,9 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
>>>>                __entry->nr_taken,
>>>>                __entry->nr_lumpy_taken,
>>>>                __entry->nr_lumpy_dirty,
>>>> -               __entry->nr_lumpy_failed)
>>>> +               __entry->nr_lumpy_failed,
>>>> +               __entry->active,
>>>> +               __entry->file)
>>>>  );
>>>>
>>>>  DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
>>>> @@ -312,9 +319,10 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
>>>>                unsigned long nr_lumpy_taken,
>>>>                unsigned long nr_lumpy_dirty,
>>>>                unsigned long nr_lumpy_failed,
>>>> -               isolate_mode_t isolate_mode),
>>>> +               isolate_mode_t isolate_mode,
>>>> +               int active, int file),
>>>>
>>>> -       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
>>>> +       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode, active, file)
>>>>
>>>>  );
>>>>
>>>> @@ -327,9 +335,10 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
>>>>                unsigned long nr_lumpy_taken,
>>>>                unsigned long nr_lumpy_dirty,
>>>>                unsigned long nr_lumpy_failed,
>>>> -               isolate_mode_t isolate_mode),
>>>> +               isolate_mode_t isolate_mode,
>>>> +               int active, int file),
>>>>
>>>> -       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
>>>> +       TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode, active, file)
>>>>
>>>>  );
>>>>
>>>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>>>> index 6aff93c..246fbce 100644
>>>> --- a/mm/memcontrol.c
>>>> +++ b/mm/memcontrol.c
>>>> @@ -1249,7 +1249,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
>>>>        *scanned = scan;
>>>>
>>>>        trace_mm_vmscan_memcg_isolate(0, nr_to_scan, scan, nr_taken,
>>>> -                                     0, 0, 0, mode);
>>>> +                                     0, 0, 0, mode, active, file);
>>>>
>>>>        return nr_taken;
>>>>  }
>>>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>>>> index f54a05b..97955ca 100644
>>>> --- a/mm/vmscan.c
>>>> +++ b/mm/vmscan.c
>>>> @@ -1103,7 +1103,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file)
>>>>  static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>>>>                struct list_head *src, struct list_head *dst,
>>>>                unsigned long *scanned, int order, isolate_mode_t mode,
>>>> -               int file)
>>>> +               int active, int file)
>>>>  {
>>>>        unsigned long nr_taken = 0;
>>>>        unsigned long nr_lumpy_taken = 0;
>>>> @@ -1221,7 +1221,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>>>>                        nr_to_scan, scan,
>>>>                        nr_taken,
>>>>                        nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
>>>> -                       mode);
>>>> +                       mode, active, file);
>>>>        return nr_taken;
>>>>  }
>>>>
>>>> @@ -1237,7 +1237,7 @@ static unsigned long isolate_pages_global(unsigned long nr,
>>>>        if (file)
>>>>                lru += LRU_FILE;
>>>>        return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, order,
>>>> -                                                               mode, file);
>>>> +                                                       mode, active, file);
>>>
>>> I guess you want to count exact scanning number of which lru list.
>>> But It's impossible now since we do lumpy reclaim so that trace's
>>> result is mixed by active/inactive list scanning.
>>> And I don't like adding new argument for just trace although it's trivial.
>> yeah, I know we do lumpy reclaim, but it has no hint about whether it is
>> a file or anon lru. So I think we at least need a 'file=[0/1]' in this
>> trace event.
>>>
>>> I think 'mode' is more proper rather than  specific 'active'.
>>> The 'mode' can achieve your goal without passing new argument "active".
>> sorry, but how can we find the real relationship between 'mode' and
>> 'active'? I am not quite familiar with this field. So if you can
>> explicit describe it, I am fine to drop this field.
> 
> 
> mode is following as,
> 
> /* Isolate inactive pages */
> #define ISOLATE_INACTIVE        ((__force fmode_t)0x1)
> /* Isolate active pages */
> #define ISOLATE_ACTIVE          ((__force fmode_t)0x2)
> /* Isolate clean file */
> #define ISOLATE_CLEAN           ((__force fmode_t)0x4)
> /* Isolate unmapped file */
> #define ISOLATE_UNMAPPED        ((__force fmode_t)0x8)
> 
> For example,
> 
> If mode is 0x1, it means we are isolating inactive.
> If mode is 0x2, it means we are isolating active.
> If mode is 0x4|0x2, it mean we are isolating clear pages in active list.
> If mode is 0x8|0x2, it mean we are isolate unmapped page in active list.
cool, thanks for the detailed explanation.
So I will drop this field, and only add 'file' to the trace event.

Thanks
Tao

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-12-12  1:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11 14:46 [PATCH V2] vmscan/trace: Add 'active' and 'file' info to trace_mm_vmscan_lru_isolate Tao Ma
2011-12-12  0:54 ` KAMEZAWA Hiroyuki
2011-12-12  0:59 ` Minchan Kim
2011-12-12  1:19   ` Tao Ma
2011-12-12  1:23     ` Minchan Kim
2011-12-12  1:26       ` Tao Ma [this message]
2011-12-12 11:27   ` Mel Gorman
2011-12-13 14:40     ` Tao Ma
2011-12-12  2:48 ` KOSAKI Motohiro
2011-12-14  0:45 ` Andrew Morton
2011-12-14 15:14   ` [PATCH v3] vmscan/trace: Add " Tao Ma
2011-12-16 22:37     ` Andrew Morton
2011-12-18  0:49     ` Minchan Kim

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=4EE55851.7040807@tao.ma \
    --to=tm@tao.ma \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hch@infradead.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=riel@redhat.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;
as well as URLs for NNTP newsgroup(s).