Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp417598ybn; Tue, 1 Oct 2019 23:44:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyq+cZz2cvwWMy0ROCBGvWvlMA01PenNPPRIxVneS2ftYBKj1GgJV9U9otzwWGt0uRrk4Lt X-Received: by 2002:a17:906:1e54:: with SMTP id i20mr1647167ejj.51.1569998694966; Tue, 01 Oct 2019 23:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569998694; cv=none; d=google.com; s=arc-20160816; b=g5DlUbwT5uwaS+ZuiDgRi9Y4/OLqY/WS9ltAC+cdnLfKKMJE6jxLch0ME77JtMZXHq e5M3VCYy1z0iGBIjKHke/lIOJlK3yYqDzijFcCk36CEAPlAu0/cfm4L0TZ8xSXtTEKJ2 34b7OMjxeFYEz42nA1PJS3aGq8rcHL5Xl2O9QY+y6mn6Da4NijNaZJbzuJHKWBp02fwk tp6jzo+uPZeaajz3ocXwSsJmEXOrDOmiKY9mfNvHQd4tHlIEwIQSPksrajG+j75OR0+H 4M20X2y83456D/PCMrEslTZ98iRFYItsW0dqSU5Gkyn4Ry3VqtDrp0dIBf19GMcUJ6op DyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=utqwTvRLyjSsVfZRkt/xO+q4bNl5CsJkNoufFxflxJQ=; b=asSRYX+4QlV0IaASdqaLT1evcOcU4Z+Xl9v+8x7pZUXSyTQoCjgudeKYDjVvgX1pqi 2Wthms696sviix1dExW9sS47nikLdM9/WIx4L/2BHNdTGqvvgryn74WoCu4a5cEk7F2y Mf4O33GtPlSrRsjtKfpG3sJHaV4ng2DHsxepIFb0nmX7tqqFCmklJw4lCwpFhfWVilx3 gkr0J/Bmes5Cfe4Xl1vKkZqFzFRcx34rehEa8pR3LbX0vw61UHjqX6h8ZuOhJZooD71H j8sLGOUd0/LtlldX5mMRRqEc9gFwfr93Jev6W6B/4OHpnsZzJJ/o2UIalfNDSG5f5oFm 0LHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oEVkss6V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t37si12299352edd.25.2019.10.01.23.44.30; Tue, 01 Oct 2019 23:44:54 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oEVkss6V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbfJBE7y (ORCPT + 99 others); Wed, 2 Oct 2019 00:59:54 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:41385 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfJBE7y (ORCPT ); Wed, 2 Oct 2019 00:59:54 -0400 Received: by mail-io1-f67.google.com with SMTP id n26so25437602ioj.8 for ; Tue, 01 Oct 2019 21:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=utqwTvRLyjSsVfZRkt/xO+q4bNl5CsJkNoufFxflxJQ=; b=oEVkss6VR+9MCsjpkKg1eW3moidaorvQjMfZN1aobBTuZpUSiliyZAD/ZB+LSjwIzx ffJcXnSgJUT6H0k5VHNZ8N0lAqZTbi+fmGXl1utWTFytCzdYlsCJfaCKQiHMCWa3jbD/ HrmS9VKmNkxVQ3WvL5HS7dGXRTvtKi+Pn4ejI9bscexXo9IjPo9FfiiZNmwCoL7uWpiE 3EIqDGN7ic+YN6gruIZhX3E2bGkGijDJxJ1YZwQHkPyE2tbdAS5ZUKUNO2Knw+uAkba+ Pi+IOwyNQJGwJMIJmh2CvkWbUL8J/ILcEGUo/IeaaUHYG/ZHyg2Z6VcRhkHylVPJcl76 w+ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=utqwTvRLyjSsVfZRkt/xO+q4bNl5CsJkNoufFxflxJQ=; b=WFaiZP60qQfj9ftGOtYpc95wYSgSQQaZXadYINjH0v6WTbhiJEi332sDgck70+ScIp +RFahhCbr05Zf8AnZFNXcfHZUu1Iayi0Hyz5fz7yUBgACLrPkobasRFVeCkX+hSwG4ul KYJe+ERcoOS1+PLJy2SdejOJJ6KiQBXgVrkJlIrzfsR685+FmepOV3RO87+R35PLT2ev 97yCNNWWF7kW5pgI47B51GCPeNKShIxfCOpWiQ6FNKbMr3svX33d5dukPPRrsbLbu4oy 9AVr1TpqVWDDbrTOKkx+DEXl9XrtzYxtl/7jt2in7xtRIHC6bgqZ386svHSfsydFBOr+ wXQQ== X-Gm-Message-State: APjAAAWuQLXW7+7NbfP8uCWOjVU6/o/ATNGbI6wGr1oH8eIK8IBkXqw6 GM4TrJ8HlyO6Ba4jtLTbeWo7EWm1y45hGiNAgeU= X-Received: by 2002:a92:4a11:: with SMTP id m17mr1998877ilf.142.1569992393636; Tue, 01 Oct 2019 21:59:53 -0700 (PDT) MIME-Version: 1.0 References: <1569899984-16272-1-git-send-email-laoar.shao@gmail.com> <20191001144524.GB3321@techsingularity.net> In-Reply-To: <20191001144524.GB3321@techsingularity.net> From: Yafang Shao Date: Wed, 2 Oct 2019 12:59:14 +0800 Message-ID: Subject: Re: [PATCH v2] perf script python: integrate page reclaim analyze script To: Mel Gorman Cc: tonyj@suse.com, acme@kernel.org, Peter Zijlstra , mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, Andrew Morton , LKML , Linux MM , Tony Jones Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 1, 2019 at 10:45 PM Mel Gorman wrote: > > 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; > eBPF requires newer kernel, while there're still lots of servers running with old kernels. The systemtap is not convenient as it requires many debug packages, and it is still not stable enough to run on the product environment, for example, the systemtap deamon may exit without uninstalling the systemtap kernel module. > 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. > This seem like a good suggestion. I will try to think about 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