linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] add detect count for hung tasks
@ 2024-10-27 12:07 Lance Yang
  2024-10-27 12:07 ` [PATCH v2 1/2] hung_task: " Lance Yang
  2024-10-27 12:07 ` [PATCH v2 2/2] hung_task: add docs for hung_task_detect_count Lance Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Lance Yang @ 2024-10-27 12:07 UTC (permalink / raw)
  To: akpm
  Cc: dj456119, cunhuang, leonylgao, j.granados, jsiddle,
	kent.overstreet, 21cnbao, ryan.roberts, david, ziy, libang.li,
	baolin.wang, linux-kernel, linux-mm, joel.granados, linux,
	Lance Yang

Hi all,

This patchset adds a counter, hung_task_detect_count, to track the number
of times hung tasks are detected. 

IHMO, hung tasks are a critical metric. Currently, we detect them by
periodically parsing dmesg. However, this method isn't as user-friendly
as using a counter.

Sometimes, a short-lived issue with NIC or hard drive can quickly decrease
the hung_task_warnings to zero. Without warnings, we must directly access
the node to ensure that there are no more hung tasks and that the system
has recovered. After all, load average alone cannot provide a clear
picture.

Once this counter is in place, in a high-density deployment pattern, we
plan to set hung_task_timeout_secs to a lower number to improve stability,
even though this might result in false positives. And then we can set a
time-based threshold: if hung tasks last beyond this duration, we will
automatically migrate containers to other nodes. Based on past experience,
this approach could help avoid many production disruptions.

Moreover, just like other important events such as OOM that already have
counters, having a dedicated counter for hung tasks makes sense ;)

---

Changes since v1 [1]
====================
 - hung_task: add detect count for hung tasks
   - Update the changelog (per Andrew)
   - Find other folks to CC (per Andrew)

[1] https://lore.kernel.org/linux-mm/20241022114736.83285-1-ioworker0@gmail.com

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(+)

-- 
2.45.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-01 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-27 12:07 [PATCH v2 0/2] add detect count for hung tasks Lance Yang
2024-10-27 12:07 ` [PATCH v2 1/2] hung_task: " Lance Yang
2024-11-01 11:48   ` Lance Yang
2024-10-27 12:07 ` [PATCH v2 2/2] hung_task: add docs for hung_task_detect_count Lance Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox