Skip to content

Commit

Permalink
drgn.helpers.linux.wait: document that waitqueue_for_each_task() can …
Browse files Browse the repository at this point in the history
…return garbage for special wait queues

For example, struct blk_mq_hw_ctx::dispatch_wait always has a NULL
private pointer, and struct kyber_hctx_data::domain_wait sets the
private pointer to a struct blk_mq_hw_ctx.

Signed-off-by: Omar Sandoval <[email protected]>
  • Loading branch information
osandov committed Dec 1, 2023
1 parent e6f43c9 commit 8ed2403
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drgn/helpers/linux/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def waitqueue_for_each_task(wq: Object) -> Iterator[Object]:
"""
Iterate over all tasks waiting on a wait queue.
.. warning::
This comes from ``wait_queue_entry_t::private``, which usually stores a
task. However, some wait queue entries store a different pointer type,
in which case this will return garbage.
:param wq: ``wait_queue_head_t *``
:return: Iterator of ``struct task_struct *`` objects.
"""
Expand Down

0 comments on commit 8ed2403

Please sign in to comment.