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 01AA9D0BB59 for ; Thu, 24 Oct 2024 04:28:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 027866B007B; Thu, 24 Oct 2024 00:28:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF3046B0082; Thu, 24 Oct 2024 00:28:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D93796B0083; Thu, 24 Oct 2024 00:28:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B928E6B007B for ; Thu, 24 Oct 2024 00:28:20 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6846B4109F for ; Thu, 24 Oct 2024 04:28:10 +0000 (UTC) X-FDA: 82707213498.15.5715497 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 6B114160005 for ; Thu, 24 Oct 2024 04:28:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=mCKAxFZX; spf=pass (imf08.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 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=1729743945; 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=+OX/W0OOYBWoYYUQyAvOHECe3vwFzlGYfkRtWkFdSLU=; b=pmNGB2DrmK1x2byKH+hkrZB7ofFg8XBkeeWzQSaVgRbG61ACNUO/JR7lmHQ45O3dmUNTHa YZV1diyDcOdsygi9IhTL31sstjX8LJwwHffqyob42MKeAKdp+owAxhIsTCCf1IywfqdQ3o esaCIwjH1qwc1tFDXbJ7pi0UCfnVggw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729743945; a=rsa-sha256; cv=none; b=bIh1fC0JUDmO9bZH671izATboIPD/VmrHoOqPTdAdB+HIWQFi4+g+HAmx0TLWSWZgKAFAn DGt1Svm9GCLsoU3bXJvbDIh1PPvIupXMQmplQj9IlE66NRrEv0VEpHu/IXCTx/q0VOC/26 MFc3biKKBbNb381/dPGkjR2BfAse+r8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=mCKAxFZX; spf=pass (imf08.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 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 dfw.source.kernel.org (Postfix) with ESMTP id CE4C65C4681; Thu, 24 Oct 2024 04:28:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98D20C4CEC7; Thu, 24 Oct 2024 04:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1729744097; bh=9Y8fehWYSHeffdmkxHbgl4Yj9Og3vVXUiE8wnyBHuvI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mCKAxFZX/vcnmvtUX32MZ+ArfbWhLMv12FL1o3XJPD5dIy3IKIfysZqCYZOYrfoh7 n31qQywn5JhHER69+D+WlMqIRh8BXXnP5KQ57ld7iTtyCTL8oP4U6mciFdj6sfGCbN kD8WCKav+mwpBmEtMaje8ZfNh+PtP/QXMrzpCMIw= Date: Wed, 23 Oct 2024 21:28:15 -0700 From: Andrew Morton To: Lance Yang Cc: cunhuang@tencent.com, leonylgao@tencent.com, j.granados@samsung.com, jsiddle@redhat.com, kent.overstreet@linux.dev, 21cnbao@gmail.com, ryan.roberts@arm.com, david@redhat.com, ziy@nvidia.com, libang.li@antgroup.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 0/2] hung_task: add detect count for hung tasks Message-Id: <20241023212815.240844bdf83e4dc17b66b88c@linux-foundation.org> In-Reply-To: References: <20241022114736.83285-1-ioworker0@gmail.com> <20241023190515.a80c77fe3fa895910d554888@linux-foundation.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: o3oabgqasm3tria4dzxpqsor7ttitmaw X-Rspamd-Queue-Id: 6B114160005 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1729744086-633962 X-HE-Meta: U2FsdGVkX180q/gUn5X/mu87mkpe+Plrv7vaPGgRyK6DlrvfepEjXdRPTa31UNoeK16zb8/gm4FQ2OOELMHBpM6fEJCDxiLji3AeQcVf4Z1IgcwqBSJZ5EgzoPw6DnbFoRSFXiYgRcYl4TIVfG56go9275ooN/M2H/fRaGspN16RkCYkhmGFn5YwU9nBQuOufkLjDsOqApw3e5eXizSjU5dNOJ8AIehOsaJ5ZLUPun/AUPXyJn/fWXE6Lp6IRqrd+KiKKx2D0gmmVnhP6Ar8+2IdMRQ60JLaBheYwFnfhtbJAV5jI6adkfDT32WgfP0C5y87cQCgrek4l2g4ta+GVvjpLwhmJbGsDpwLAqDUCppllYfyUZDpW0D4+WseLckg4QGOyRwQikEBggms+34avye+1sDCJTsDMLjBbcM0xSeWLG0oGKeJWGPBwyurSRuc23DvFGw2FQeKuMBTlsEAJTqljhtUqyonOkOIIYyJ4YmIBLmw9gQ8S8GYTqYqOaPtwKYb74xgwzqHQpxDNWnu5wchm2NkIMD3gK0X+JLL1HOJXFexv7aculTGzOQ/OYmiKGnOjgqVuPHoZr2NAFMbDHDxPiw2nALhk3Xqs0ml5ehagt+AG4wVv3mIQBBGVDvFzk6bRip6eBzMHt8LLDxn70NrgI3HQ/+6jvmuYYwsVdu2CPDO0Rcn9o/PqFwapCN/c/zZ/8KEFYGXbl4+rF99Z4/epasKUef1CjUPga+fuYBKJnKqtnT2gR6KD2jjcpJKJbYfFDmvENFHXQQMWEHi8qSgKqd3j48hCJiedCvJXNx6drhZVG6W9D2uhcsPImfFlF7iKS+kQhdrsNCJzTurHr6V8MFAq5YJvz5TEh1rZey3syWSu95UDCpBKlh04gdDF/6Ucd1kMyx6k6K9/wSONYSfUMVUz8+383Ea2n68DktU/KvbI6Kr1hyw0XEVIaLKcw+H4wygaO03zYE46NO vx/LkqYg XJBqcdSsIXAt9C4YvFpTFKbqIUgXQh9bm12nJhBOaFFvYKPPjuJOX6aR8r++EaHNyHhAuw2QNZu+ltSUDYHlKxqUi0EhyFy63hTaJv93bRqTPwftgP2DKhzN20VpA75AcLvuS0Q1MXAzvuHQRu8JNk4OZOV2zbn5RP2xl+F5JwujDVez6tkRNATXkbZJMoAld+l8jjXW59oBEjSveLuXv5IayG5O26JvWeRS94fPa9CDxxqH/ORFhZBHd6/r0F0C2+bKygMzrJUuS/2D3lgKUKnP70iquOFFtLfyavfFUqy2v+F0wpg5WEBQANk3HsJzcOll1f4e5FQz8Bj8CM3yUXaAUKGIH3bT/N+BA3Jxg6JusruGrjSPxPhBLhreVFZd6ujEUibkFO1I6O/LuLEct6wGcJA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001725, 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, 24 Oct 2024 11:28:01 +0800 Lance Yang wrote: > Hi Andrew, > > Thanks a lot for paying attention! > > On Thu, Oct 24, 2024 at 10:05 AM Andrew Morton > wrote: > > > > On Tue, 22 Oct 2024 19:47:34 +0800 Lance Yang wrote: > > > > > Hi all, > > > > > > This patchset adds a counter, hung_task_detect_count, to track the number of > > > times hung tasks are detected. This counter provides a straightforward way > > > to monitor hung task events without manually checking dmesg logs. > > > > > > With this counter in place, system issues can be spotted quickly, allowing > > > admins to step in promptly before system load spikes occur, even if the > > > hung_task_warnings value has been decreased to 0 well before. > > > > > > Recently, we encountered a situation where warnings about hung tasks were > > > buried in dmesg logs during load spikes. Introducing this counter could > > > have helped us detect such issues earlier and improve our analysis efficiency. > > > > > > > Isn't the answer to this problem "write a better parser"? I mean, > > Yeah, I certainly agree that having a good parser is important, and I'm > working on that as well ;) > > > we're providing userspace with information which is already available. > > IHMO, there are two reasons why this counter remains valuable: > > 1) It allows us to easily detect hung tasks in time before load spikes occur, > using simple and common monitoring tools like Prometheus. But the new sysctl_hung_task_detect_count counter gets incremented a microsecond before the printk comes out. I don't understand the difference. > 2) It ensures that we remain aware of hung tasks even when the > hung_task_warnings value has already been decreased to 0 well before. That makes sense, I guess. But fleshing this out with a real operational scenario would help persuade reviewers of the benefit of this change. So please describe the utility with full details - sell it to us!