From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91ABAC7115A for ; Sun, 22 Jun 2025 22:48:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D0136B00AB; Sun, 22 Jun 2025 18:48:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A7536B00AC; Sun, 22 Jun 2025 18:48:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E5196B00AD; Sun, 22 Jun 2025 18:48:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F2E5B6B00AB for ; Sun, 22 Jun 2025 18:48:51 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 12EEE121E22 for ; Sun, 22 Jun 2025 22:48:51 +0000 (UTC) X-FDA: 83584528062.05.63A7A7A Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf12.hostedemail.com (Postfix) with ESMTP id 6040F40002 for ; Sun, 22 Jun 2025 22:48:49 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="v/rlhubF"; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750632529; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fG3aBUGBvhxrxTc+fpd1DkbRoHHdSaDuu0gcDMwTCbg=; b=HX9Pvtmmlzl0mxKEcZWTbQicTcqinuC9c+f5miC1a2zutPL69/2n6+a8Om9ablCJ8cIpL8 cksPYs4lkCDQCqFZO7MTbB1VguuiqlewxXpJDn9UGU0eqQ3nXQDT3JMN0NRLRUS5sOUKoa ZInjGJ7gqS4GbMnPPyye2TvUNdNeNP8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750632529; a=rsa-sha256; cv=none; b=bdg6OdLfxTEwu8+LBt9OLwTL99RW4vudXSuhCVrVzdjync2atN/gAi7uk2ucfMPmombWyw iPIS+lxbAVQmYVeGAEIupJvfTb+iecxRrGD1+RZx9i4jM8CFphamRfPGCFSYVtjy98oqXH Cr9MLoAsF4LdmAjn8u2oZTRc1z5VfzE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="v/rlhubF"; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 99114A4E62C; Sun, 22 Jun 2025 22:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C218FC4CEE3; Sun, 22 Jun 2025 22:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1750632528; bh=T5+Prpht3oUvEsd/DGDLvYFZkGwgGKSbQdhp2/015Qo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=v/rlhubFFaG3l6cMyZwfDk6KrVEWd4cTEInXO1IL+xCdsCzCNA3mM5gfQ2JuTjAHz vBdRWrdJkcyLvJIX1z0dR7NoZxeaiKY1/lis5Wm6jGigeDststZSSkgGqSJIdTUlYf 9ykFRgsyhVNIyZYr1arpcza25KWiYSLe+ih6MCyM= Date: Sun, 22 Jun 2025 15:48:47 -0700 From: Andrew Morton To: Cc: , , , , , , , , , , , , , , Subject: Re: [PATCH linux next] tools/accounting/delaytop: add delaytop to record top-n task delay Message-Id: <20250622154847.f7ea3c8c5b2c1193bf9bcbcf@linux-foundation.org> In-Reply-To: <20250619211843633h05gWrBDMFkEH6xAVm_5y@zte.com.cn> References: <20250619211843633h05gWrBDMFkEH6xAVm_5y@zte.com.cn> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Stat-Signature: zna746hhut6dr9o738nixj9i1zbcm7w3 X-Rspam-User: X-Rspamd-Queue-Id: 6040F40002 X-HE-Tag: 1750632529-77527 X-HE-Meta: U2FsdGVkX198EHmfahxCQPDg4nXHGc6nbvoa6iKnvl5L9HB3ChfHm1Sr3lQZ/PAIRsLyiVjoLo39MEvPOuLGpax9VZg9bO6kPp2xDowGO8fsUZfMFtvdGKIoX/G1piEySz0NZafdF7PPimZXF3a+MwjYz87e5TBF8a5rUnJbF45xJb7ZP06nvUx72jeKn6t4vgVg5Vq/cL2HuYu4oqDa58iLvJLe2ZTSeH0ZWTHeSVOz3Ju6CJnthq6ZHHgIKwtArSr/96w/5vth7GT+bwajzuVfrkz7BW47KI6nrGv5c9XUYKJJ9IvSm2zqehg/KqqjC5wsNxRjzEHoCrqX1fRWlVfuqFkzeo4786WKZbI+MXUvvEXkhR0MLzfR5mc9+vQejqjp1TvuwGyv6Itd0qY4672sHI/epOcCin9buQqZ8XrhaS8qUYuFzx8pQqxHk37W31ecaRlmD9znrCMlYq6vXDJHQkhYsyfnCObPs7Y+xAugfaXLWcpKI/V8zxkXTFh4SIX+ANGxmOWP01GhQ2ftZn0eg48LophCRzyKk5S2thg+/5lhCEyzJk5IXDS42DNAawNb3IlaV0Igkw/qj01X/GVE6cnRExX6IIMXXHtabsPizluQGaF80Rukfw9s4ZL2nwoakZW1ZlP4xAllrIHiKKnZzqPakTu+xMZnYHieVWLH/eG/saoYVmDGzMiAP9ibdDHMFa+eSE/DzCHXmEORMZnONBXhJelqJxSt0YB/Gq7OKFH8aCjE/q2gfABiAEF13En5SqMOQSpQcZO1jGpujOZg5PGa5C1c08NUBnESwSNrhhUvMVuFsu7OJ2cNfSaPA/WOgxCNufvcOnqCkmuNYfTGhIzPDYhWH+mb+tjU9MDkQOCDNecpmS72GSde5bwUpjerjpP+inWF/hp39GDfWqsuiQ3QIuTyprmVT0cqtWh/4DGkYg26pt8QdwWa9OecegC45XCPEd1oGBetC6C +5jd5YQs RbgQmHgu1qsGF0SWlUYVjvnKrrQ1wsyuj+5u3p2boB/0+tw3iQtJDEwlh2dms7DjlRU5zU97Hw8xRkCbPNaCk6TvDHYBo5Z0c9T36+VuFat8ljFGshCIym6jdvXba4CONy8qHe9zDhat83Q4bJWHU8C4850f5ANmFWUnmOzWEcs4DHAHQjDH3qDZ+fEC6RxBdZlMoUz9ri7szf0ZhLWDOBe2OC5ADATYgCW708WTkvRzwUpFTIDaDIahvmukbJVNuUHWQ4H3a65oDI0GJiOI6lFpdmRHKEM9k+QVF8hNck2z7IOUSX84zGJ2nMA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 19 Jun 2025 21:18:43 +0800 (CST) wrote: > From: Yaxin Wang > > Problem > ======= > The "getdelays" can only display the latency of a single task > by specifying a PID, but it has the following limitations: > 1. single-task perspective: only supports querying the > latency (CPU, I/O, memory, etc.) of an individual task via > PID and cannot provide a global analysis of high-latency > processes across the system. > 2. lack of High-Latency process awareness: when the overall > system latency is high (e.g., a spike in CPU latency), there > is no way to quickly identify the top N processes contributing > to the highest latency. > 3. poor interactivity: It lacks dynamic sorting and refresh > capabilities (similar to top), making it difficult to monitor > latency changes in real time. > > Solution > ======== > To address these limitations, we introduce the "delaytop" with > the following capabilities: > 1. system view: monitors latency metrics (CPU, I/O, memory, IRQ, > etc.) for all system processes > 2. supports field-based sorting (e.g., default sort by CPU latency > in descending order) > 3. dynamic interactive interface: > focus on specific processes with --pid; > limit displayed entries with --processes 20; > control monitoring duration with --iterations; > > Use case > ======== > bash# ./delaytop Looks nice, thanks. > tools/accounting/Makefile | 2 +- > tools/accounting/delaytop.c | 673 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 674 insertions(+), 1 deletion(-) > create mode 100644 tools/accounting/delaytop.c Some documentation would be nicer ;) hp2:/usr/src/25> grep -rli getdelays Documentation Documentation/translations/zh_CN/accounting/delay-accounting.rst Documentation/translations/zh_CN/accounting/taskstats.rst Documentation/accounting/delay-accounting.rst Documentation/accounting/cgroupstats.rst Documentation/accounting/taskstats.rst