linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: Tony Jones <tonyj@suse.de>, Mel Gorman <mgorman@techsingularity.net>
Cc: Peter Zijlstra <peterz@infradead.org>,
	acme@kernel.org, namhyung@kernel.org,
	 Andrew Morton <akpm@linux-foundation.org>,
	jolsa@redhat.com, mingo@redhat.com,
	 Linux MM <linux-mm@kvack.org>,
	Florian Schmidt <florian.schmidt@nutanix.com>,
	 Daniel Jordan <daniel.m.jordan@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] perf script python: integrate page reclaim analyze script
Date: Thu, 26 Sep 2019 12:42:20 +0800	[thread overview]
Message-ID: <CALOAHbCho+SjpfaWrKFAoK-2CKMaqc4dyevk5kC-qenHgnHS5A@mail.gmail.com> (raw)
In-Reply-To: <456c8216-a9f4-6821-e688-744e93df826f@suse.de>

On Thu, Sep 26, 2019 at 9:56 AM Tony Jones <tonyj@suse.de> wrote:
>
> On 9/18/19 7:38 AM, Yafang Shao wrote:
> > A new perf script page-reclaim is introduced in this patch. This new script
> > is used to report the page reclaim details. The possible usage of this
> > script is as bellow,
> > - identify latency spike caused by direct reclaim
> > - whehter the latency spike is relevant with pageout
> > - why is page reclaim requested, i.e. whether it is because of memory
> >   fragmentation
> > - page reclaim efficiency
> > etc
> > In the future we may also enhance it to analyze the memcg reclaim.
> >
> > Bellow is how to use this script,
> >     # Record, one of the following
> >     $ perf record -e 'vmscan:mm_vmscan_*' ./workload
> >     $ perf script record page-reclaim
> >
> >     # Report
> >     $ perf script report page-reclaim
> >
> >     # Report per process latency
> >     $ perf script report page-reclaim -- -p
>
>
> I tested it with global-dhp__pagereclaim-performance from mmtests and got what appears to be reasonable results and the output looks correct and useful.  However I'm not a vm expert so I can't comment further.  Hopefully someone on linux-mm can give more specific feedback.
>

+ Mel

Hi Mel,

This is motivated by
Documentation/trace/postprocess/trace-vmscan-postprocess.pl created by
you.
Could you pls. help take a look ?

Thanks
Yafang

> There is one issue with Python3,  see below.  I didn't test with Python2.
>
> >
> > +     @classmethod
> > +     def shrink_inactive(cls, pid, scanned, reclaimed, flags):
> > +             event = cls.events.get(pid)
> > +             if event and event.tracing():
> > +                     # RECLAIM_WB_ANON 0x1
> > +                     # RECLAIM_WB_FILE 0x2
> > +                     _type = (flags & 0x2) >> 1
> > +                     event.process_lru(lru[_type], scanned, reclaimed)
> > +
> > +     @classmethod
> > +     def writepage(cls, pid, flags):
> > +             event = cls.events.get(pid)
> > +             if event and event.tracing():
> > +                     # RECLAIM_WB_ANON 0x1
> > +                     # RECLAIM_WB_FILE 0x2
> > +                     # RECLAIM_WB_SYNC 0x4
> > +                     # RECLAIM_WB_ASYNC 0x8
> > +                     _type = (flags & 0x2) >> 1
> > +                     _io = (flags & 0x4) >> 2
> > +
> > +                     event.process_writepage(lru[_type], sync_io[_io])
> > +
> > +        @classmethod
>
> Space indentation on line above.  For python3 this results in:
>
>   File "tools/perf/scripts/python/page-reclaim.py", line 217
>     @classmethod
>                ^
> TabError: inconsistent use of tabs and spaces in indentation
>
> > +     def iterate_proc(cls):
> > +             if show_opt != Show.DEFAULT:
> > +                     print("\nPer process latency (ms):")
> > +                     print_proc_latency(latency_metric, 'pid', '[comm]')
> > +
> > +                     if show_opt == Show.VERBOSE:
> > +                             print("%20s  %s" % ('timestamp','latency(ns)'))
>
>
> Thanks
>
> Tony
>


  parent reply	other threads:[~2019-09-26  4:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 14:38 [PATCH 0/2] introduce new perf-script page-reclaim Yafang Shao
2019-09-18 14:38 ` [PATCH 1/2] perf script python: integrate page reclaim analyze script Yafang Shao
2019-09-26  1:56   ` Tony Jones
2019-09-26  3:36     ` Tony Jones
2019-09-26  4:37       ` Yafang Shao
2019-09-26  4:42     ` Yafang Shao [this message]
2019-09-18 14:38 ` [PATCH 2/2] tracing, vmscan: add comments for perf script page-reclaim Yafang Shao

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=CALOAHbCho+SjpfaWrKFAoK-2CKMaqc4dyevk5kC-qenHgnHS5A@mail.gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.m.jordan@oracle.com \
    --cc=florian.schmidt@nutanix.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tonyj@suse.de \
    /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