lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 26 Sep 2019 12:42:20 +0800
From:   Yafang Shao <laoar.shao@...il.com>
To:     Tony Jones <tonyj@...e.de>,
        Mel Gorman <mgorman@...hsingularity.net>
Cc:     Peter Zijlstra <peterz@...radead.org>, acme@...nel.org,
        namhyung@...nel.org, Andrew Morton <akpm@...ux-foundation.org>,
        jolsa@...hat.com, mingo@...hat.com, Linux MM <linux-mm@...ck.org>,
        Florian Schmidt <florian.schmidt@...anix.com>,
        Daniel Jordan <daniel.m.jordan@...cle.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] perf script python: integrate page reclaim analyze script

On Thu, Sep 26, 2019 at 9:56 AM Tony Jones <tonyj@...e.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ