From patchwork Tue Oct 22 11:47:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Yang X-Patchwork-Id: 13845621 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 4FB2AD3C932 for ; Tue, 22 Oct 2024 11:48:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8EDA6B0083; Tue, 22 Oct 2024 07:48:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C18B06B0085; Tue, 22 Oct 2024 07:48:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB8AE6B0088; Tue, 22 Oct 2024 07:48:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8D8686B0083 for ; Tue, 22 Oct 2024 07:48:10 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 638201C7949 for ; Tue, 22 Oct 2024 11:47:51 +0000 (UTC) X-FDA: 82701064404.18.17EE412 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf23.hostedemail.com (Postfix) with ESMTP id E6678140015 for ; Tue, 22 Oct 2024 11:47:57 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LWLeX8qn; spf=pass (imf23.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729597537; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Aix/fJFji8qXSyMgAkZiqUftW7RkYeP6GgFXFbZAYu4=; b=lNEJIuyjhxhmNzxRwEra4fVCrRQS+FI9J94cmxSK6SKg4fHo7YCPvW2LXe6lAp1w3kp/un ZEGwT5hamX96RiHqJHjtNwmLfDibD0pV15D+cJ3ey5nufCxZePC1L9ahon09COOdO/2UuW Xt8ko0r10lQOyb3Q0wL1iR9L2EALHhk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729597537; a=rsa-sha256; cv=none; b=eJ9M6eYEaaQpvpgKBLqCWRF0E6+YwVQAzrUs+BnbarCukTE4pcfZ+3hj/iTqPaTe0pJAjO No16eoBrEah823TZHTkZWmmeV1fggX/O/oleDTj9+/8/DybFR358oIEcL2TCk2YXMFBcXn GMwaq/OYfH7m+LcC670w8eVnN1gT5ck= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LWLeX8qn; spf=pass (imf23.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-207115e3056so45566455ad.2 for ; Tue, 22 Oct 2024 04:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729597687; x=1730202487; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Aix/fJFji8qXSyMgAkZiqUftW7RkYeP6GgFXFbZAYu4=; b=LWLeX8qnyeUYRX1oLlXcmdRz3GCvQuNzNyv52+3OC1aY27Fs8YkxmuunDGxOqBS8rD WPiWkwcabHsgm3SJmyw2cs8fpAooWNGFr4EGlo1m+Myk5xPgscP3z11xLeroyBL5zPab 56GuZUIsboZfbcIEB2fg0jbR309Lzlf/xpsD+pxPNe8Yt9I6sahTkTSiROVJayGMV1Hp MXkQ4diDa2hN2rJKJBxrfH/HzgwJwHIC0bFcKqB62sMlxn+wRi1wFNKnRRdUzAh3o74z fvfM3LoHX6qpUxV7pjhTrn5nWk1lyVDFbwzCmAnF5kRrMNYw+BzMFJRztiLi4C80Ki4B RXdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729597687; x=1730202487; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Aix/fJFji8qXSyMgAkZiqUftW7RkYeP6GgFXFbZAYu4=; b=jdIboyu1dt5YUFf63Ven2mbRTrbmMr9oZi228zcMydbWRbGmDoDF/PeYzWyuyoV4S3 QmboUQF6y718Uv5V1+1uEnao2hukperKfuIJtHV8zC3utChISrsFLcrIp1MoLm3tJq96 Hg+38HZgvEU7D/RhlAFUyAuW5JcDhMmM3eNbPr4/minmRATr47UD1hQe9i4ya2yNGkm6 oz7Pi5qlnBidk8Tbstg1GCa+GR2BvzTeGxfTcfUNhK48o/nQQjR6DjZcxjLu9qGsRvMD GVUCQZAxQps5mve2b6EvqBpVpPBm2yBTsmK7y3uMs2sXbQcoHPjSQCc8+CjtFNt97GDs frqg== X-Forwarded-Encrypted: i=1; AJvYcCXCcj2jg3Qds/vsCOcTswCq/OmAngr1zwrywnc1iPEZW2yIfji/WzpMnzx+l0ooFQqPg5Xdre2lEw==@kvack.org X-Gm-Message-State: AOJu0YxURstYnP+WIUX0Gm6JfRL8guUfXMZPsQTkKHSbyt+QWBRjUCSH /PxgSE4fV/cZfXOd6XKEtjNLbn8J+GdOKV1XvY6nF4D+0Tx97bdw X-Google-Smtp-Source: AGHT+IHZfTrQSfOJKUUPfVwkqMDL5NClGIhS/oFuKKL/FMeRej9NneZsBbGCfBBEYnh2eoq4NXO9tQ== X-Received: by 2002:a17:903:990:b0:20c:cf39:fe3c with SMTP id d9443c01a7336-20e5a9055d7mr237378955ad.41.1729597686741; Tue, 22 Oct 2024 04:48:06 -0700 (PDT) Received: from EBJ9932692.tcent.cn ([43.129.202.66]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7ef0e13bsm41147145ad.65.2024.10.22.04.48.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Oct 2024 04:48:06 -0700 (PDT) From: Lance Yang To: akpm@linux-foundation.org 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, Lance Yang Subject: [PATCH 0/2] hung_task: add detect count for hung tasks Date: Tue, 22 Oct 2024 19:47:34 +0800 Message-ID: <20241022114736.83285-1-ioworker0@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E6678140015 X-Stat-Signature: bpg6jah6dda1ne9boqdx9heg5wz9ywiw X-HE-Tag: 1729597677-87068 X-HE-Meta: U2FsdGVkX18wAfsMcvDLD2G65NzfCsgSxZXqbBKvl5PZjspjXa6k3/CeYGcePpuKoA7jviO+R+U4kol5xgy/+bMd8ikbPOB2ULKAQMJkhHKldM12vv9nSytzw0WtIh1xSCYJGJzbaMjSerEz8AnedCYzos5cZxGlFSlBHR7QDiFJ2w4SEhXELHBYwMonwVbXLjBZCsIcnQQKTd9is671BZeFicF7EQypn8gIv8IPY5g6FKouXB8XZoBah7he+dQI1zCKqTCTg7iuf1YLkiFFmBdNdYYw2xpbmwAbW5pmTZTvhBEGq9BoJ1lbu6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tSmU66bXZGbYKoMTNbF3b6+z/6BKxU9KM8SvY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.003540, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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. Lance Yang (2): hung_task: add detect count for hung tasks hung_task: add docs for hung_task_detect_count Documentation/admin-guide/sysctl/kernel.rst | 9 +++++++++ kernel/hung_task.c | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+)