<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/samples/hung_task, branch v6.18.21</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>samples: enhance hung_task detector test with read-write semaphore support</title>
<updated>2025-07-20T02:08:26+00:00</updated>
<author>
<name>Zi Li</name>
<email>zi.li@linux.dev</email>
</author>
<published>2025-06-27T07:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=4efec6c0919d9081a52be50d5b5bfa32bf489c75'/>
<id>4efec6c0919d9081a52be50d5b5bfa32bf489c75</id>
<content type='text'>
Extend the hung_task detector test module to include read-write semaphore
support alongside existing mutex and semaphore tests.  This module now
creates additional debugfs files under &lt;debugfs&gt;/hung_task, namely
'rw_semaphore_read' and 'rw_semaphore_write', in addition to 'mutex' and
'semaphore'.  Reading these files with multiple processes triggers a
prolonged sleep (256 seconds) while holding the respective lock, enabling
hung_task detector testing for various locking mechanisms.

This change builds on the extensible hung_task_tests module, adding
read-write semaphore functionality to improve test coverage for kernel
locking primitives.  The implementation ensures proper lock handling and
includes checks to prevent redundant data reads.

Usage is:

        &gt; cd /sys/kernel/debug/hung_task
        &gt; cat mutex &amp; cat mutex           # Test mutex blocking
        &gt; cat semaphore &amp; cat semaphore   # Test semaphore blocking
        &gt; cat rw_semaphore_write \
            &amp; cat rw_semaphore_read       # Test rwsem blocking
        &gt; cat rw_semaphore_write \
            &amp; cat rw_semaphore_write      # Test rwsem blocking

Update the Kconfig description to reflect the addition of read-write
semaphore debugfs files.

Link: https://lkml.kernel.org/r/20250627072924.36567-4-lance.yang@linux.dev
Signed-off-by: Zi Li &lt;zi.li@linux.dev&gt;
Suggested-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: John Stultz &lt;jstultz@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Mingzhe Yang &lt;mingzhe.yang@ly.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the hung_task detector test module to include read-write semaphore
support alongside existing mutex and semaphore tests.  This module now
creates additional debugfs files under &lt;debugfs&gt;/hung_task, namely
'rw_semaphore_read' and 'rw_semaphore_write', in addition to 'mutex' and
'semaphore'.  Reading these files with multiple processes triggers a
prolonged sleep (256 seconds) while holding the respective lock, enabling
hung_task detector testing for various locking mechanisms.

This change builds on the extensible hung_task_tests module, adding
read-write semaphore functionality to improve test coverage for kernel
locking primitives.  The implementation ensures proper lock handling and
includes checks to prevent redundant data reads.

Usage is:

        &gt; cd /sys/kernel/debug/hung_task
        &gt; cat mutex &amp; cat mutex           # Test mutex blocking
        &gt; cat semaphore &amp; cat semaphore   # Test semaphore blocking
        &gt; cat rw_semaphore_write \
            &amp; cat rw_semaphore_read       # Test rwsem blocking
        &gt; cat rw_semaphore_write \
            &amp; cat rw_semaphore_write      # Test rwsem blocking

Update the Kconfig description to reflect the addition of read-write
semaphore debugfs files.

Link: https://lkml.kernel.org/r/20250627072924.36567-4-lance.yang@linux.dev
Signed-off-by: Zi Li &lt;zi.li@linux.dev&gt;
Suggested-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: John Stultz &lt;jstultz@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Mingzhe Yang &lt;mingzhe.yang@ly.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: extend hung_task detector test with semaphore support</title>
<updated>2025-05-12T00:54:08+00:00</updated>
<author>
<name>Zi Li</name>
<email>amaindex@outlook.com</email>
</author>
<published>2025-04-14T14:59:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=1abf729e9d9f4eb42c01fa9cb86eeb1766ecd49f'/>
<id>1abf729e9d9f4eb42c01fa9cb86eeb1766ecd49f</id>
<content type='text'>
Extend the existing hung_task detector test module to support multiple
lock types, including mutex and semaphore, with room for future additions
(e.g., spinlock, etc.).  This module creates dummy files under
&lt;debugfs&gt;/hung_task, such as 'mutex' and 'semaphore'.  The read process on
any of these files will sleep for enough long time (256 seconds) while
holding the respective lock.  As a result, the second process will wait on
the lock for a prolonged duration and be detected by the hung_task
detector.

This change unifies the previous mutex-only sample into a single,
extensible hung_task_tests module, reducing code duplication and improving
maintainability.

Usage is:

	&gt; cd /sys/kernel/debug/hung_task
	&gt; cat mutex &amp; cat mutex          # Test mutex blocking
	&gt; cat semaphore &amp; cat semaphore  # Test semaphore blocking

Update the Kconfig description to reflect multiple debugfs files support.

Link: https://lkml.kernel.org/r/20250414145945.84916-4-ioworker0@gmail.com
Signed-off-by: Lance Yang &lt;ioworker0@gmail.com&gt;
Signed-off-by: Zi Li &lt;amaindex@outlook.com&gt;
Suggested-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: John Stultz &lt;jstultz@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Mingzhe Yang &lt;mingzhe.yang@ly.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the existing hung_task detector test module to support multiple
lock types, including mutex and semaphore, with room for future additions
(e.g., spinlock, etc.).  This module creates dummy files under
&lt;debugfs&gt;/hung_task, such as 'mutex' and 'semaphore'.  The read process on
any of these files will sleep for enough long time (256 seconds) while
holding the respective lock.  As a result, the second process will wait on
the lock for a prolonged duration and be detected by the hung_task
detector.

This change unifies the previous mutex-only sample into a single,
extensible hung_task_tests module, reducing code duplication and improving
maintainability.

Usage is:

	&gt; cd /sys/kernel/debug/hung_task
	&gt; cat mutex &amp; cat mutex          # Test mutex blocking
	&gt; cat semaphore &amp; cat semaphore  # Test semaphore blocking

Update the Kconfig description to reflect multiple debugfs files support.

Link: https://lkml.kernel.org/r/20250414145945.84916-4-ioworker0@gmail.com
Signed-off-by: Lance Yang &lt;ioworker0@gmail.com&gt;
Signed-off-by: Zi Li &lt;amaindex@outlook.com&gt;
Suggested-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Acked-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: John Stultz &lt;jstultz@google.com&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Mingzhe Yang &lt;mingzhe.yang@ly.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samples: add hung_task detector mutex blocking sample</title>
<updated>2025-03-22T05:10:04+00:00</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2025-02-25T07:02:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2158599a4b6d735e1a57c8320723ca74c42dd7ae'/>
<id>2158599a4b6d735e1a57c8320723ca74c42dd7ae</id>
<content type='text'>
Add a hung_task detector mutex blocking test sample code.

This module will create a dummy file on the debugfs.  That file will cause
the read process to sleep for enough long time (256 seconds) while holding
a mutex.  As a result, the second process will wait on the mutex for a
prolonged duration and be detected by the hung_task detector.

Usage is;

 &gt; cd /sys/kernel/debug/hung_task
 &gt; cat mutex &amp; cat mutex

and wait for hung_task message.

[akpm@linux-foundation.org: make `hung_task_dir' static]
  Closes: https://lore.kernel.org/oe-kbuild-all/202503180827.4StpuFrD-lkp@intel.com/
Link: https://lkml.kernel.org/r/174046696281.2194069.4567490148001547311.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Lance Yang &lt;ioworker0@gmail.com&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a hung_task detector mutex blocking test sample code.

This module will create a dummy file on the debugfs.  That file will cause
the read process to sleep for enough long time (256 seconds) while holding
a mutex.  As a result, the second process will wait on the mutex for a
prolonged duration and be detected by the hung_task detector.

Usage is;

 &gt; cd /sys/kernel/debug/hung_task
 &gt; cat mutex &amp; cat mutex

and wait for hung_task message.

[akpm@linux-foundation.org: make `hung_task_dir' static]
  Closes: https://lore.kernel.org/oe-kbuild-all/202503180827.4StpuFrD-lkp@intel.com/
Link: https://lkml.kernel.org/r/174046696281.2194069.4567490148001547311.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
Cc: Anna Schumaker &lt;anna.schumaker@oracle.com&gt;
Cc: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Joel Granados &lt;joel.granados@kernel.org&gt;
Cc: Kent Overstreet &lt;kent.overstreet@linux.dev&gt;
Cc: Lance Yang &lt;ioworker0@gmail.com&gt;
Cc: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tomasz Figa &lt;tfiga@chromium.org&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Yongliang Gao &lt;leonylgao@tencent.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
