Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8412794ybn; Tue, 1 Oct 2019 07:47:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2ZJXvj+BmMelJ4kLouyLkXmjPRZ3/4chmj3t8NiAVFRTmz61cJSF5VuH8FlKrZjKgpHgR X-Received: by 2002:a17:906:254d:: with SMTP id j13mr24461422ejb.30.1569941242128; Tue, 01 Oct 2019 07:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569941242; cv=none; d=google.com; s=arc-20160816; b=oxomnv6k6dNdE4aobg0wnQMTaD2dW4+A9qxkK8bhsln/6NfFKu60NehL72C4xowlUU IjyZ1BGSYRCmX2tycqKTd/te1ikmbHBZPEiFeSVZIkPhBzBUp/WApw5gGb29WUnVWNC5 +MBB33IaSa5pLEJHW1cM5vMHmU4R3Jed7kmYSTaCrI4kDTk78T5xzUTPZWA9Wd+ga7To pW1MlpGH5BSt1APsN4t9Sy5FgtcqfzVSR3125FBbw01k7g563kswUwNIrIEMBjdW8Euj 4yUR064qJfct6XoOoM7mxoD20UxbvQJpX3VUO9JDuyIE8LgSixsJFwTzgCFimOsmaSWQ hZQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RYmKPSH0RmLUksicwyP9KEza9uRymoTu/jC8Anw37Bs=; b=VEh1oL2WFvmI7BdQOH9meYHIB5SyjgSXzBfV3uhHrO6ElPcZnHZBbbsX1dYgTYZpWw 5HaIN1UHVI5TuH5cLwaMoLi3DfQqW6467QA6ZMeD2AyPgL60QCVCth4rOCMj8S1xIx3l lPgQG5X5gQn5lPiLRyllRxexGtxFx6ijAu/zLSkreUz5JFQoHBBilkDb9ewJME8OHMwu KPqncpRooXn6+dGY5ywgsLC9j0Fr34P2YCaUY3BnqoS2X60T5hBTuBNXlOBgrD3CoCqn 6XqkJe7yGjLId58ivs/dScwMCkn5mUmS5WglR8iEsiy9cd4GhaJKxsX1Ygl4HqD7bVtv Ly4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 57si9936482edz.280.2019.10.01.07.46.56; Tue, 01 Oct 2019 07:47:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389264AbfJAOp2 (ORCPT + 99 others); Tue, 1 Oct 2019 10:45:28 -0400 Received: from outbound-smtp04.blacknight.com ([81.17.249.35]:40674 "EHLO outbound-smtp04.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbfJAOp2 (ORCPT ); Tue, 1 Oct 2019 10:45:28 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp04.blacknight.com (Postfix) with ESMTPS id 2351C98941 for ; Tue, 1 Oct 2019 15:45:27 +0100 (IST) Received: (qmail 10165 invoked from network); 1 Oct 2019 14:45:27 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.19.210]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 1 Oct 2019 14:45:26 -0000 Date: Tue, 1 Oct 2019 15:45:24 +0100 From: Mel Gorman To: Yafang Shao Cc: tonyj@suse.com, acme@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Tony Jones Subject: Re: [PATCH v2] perf script python: integrate page reclaim analyze script Message-ID: <20191001144524.GB3321@techsingularity.net> References: <1569899984-16272-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1569899984-16272-1-git-send-email-laoar.shao@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 11:19:44PM -0400, 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. > Hi, I ended up not reviewing this patch in detail simply because I would approach the same class of problem in an entirely different way today. There is value in accumulating the stats in a report like this; > $ perf script report page-reclaim > Direct reclaims: 4924 > Direct latency (ms) total max avg min > 177823.211 6378.977 36.114 0.051 > Direct file reclaimed 22920 > Direct file scanned 28306 > Direct file sync write I/O 0 > Direct file async write I/O 0 > Direct anon reclaimed 212567 > Direct anon scanned 1446854 > Direct anon sync write I/O 0 > Direct anon async write I/O 278325 > Direct order 0 1 3 > 4870 23 31 > Wake kswapd requests 716 > Wake order 0 1 > 715 1 > > Kswapd reclaims: 9 However, the basic option I would prefer is having the raw latency information for Direct latency that can be externally parsed by R or any other statistical method. The reason why is because knowing the max latency is not enough, I'd want to know the spread of latencies and whether they were clustered at a point of time or spread out over long periods of time. I would then build the higher-level reports on top if necessary. Today, I would also have considered getting the latency figures using eBPF or systemtap instead although having perf do it may be useful too. That's not universally popular though so at minimum I would have; perf script record page-reclaim -- capture all page-reclaim tracepoints perf script report page-reclaim -- For reclaim entry/exit, merge the two tracepoints into one that reports latency. Dump the rest out verbatim For latencies, I would externally post-process them until such time as I found a common class of bug that needed a high-level report and then build the perf script support for it. Please note that I did not spot anything wrong with your script, it's just that I would not use it myself in its current format for debugging a reclaim-related problem. -- Mel Gorman SUSE Labs