From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/virtio: add timeout to virtqueue wait to avoid hung task
Date: Sat, 16 May 2026 13:58:17 +1000 [thread overview]
Message-ID: <review-overall-20260512-virtio-gpu_wait_event-v1-1-207eb4c1a69a@redhat.com> (raw)
In-Reply-To: <20260512-virtio-gpu_wait_event-v1-1-207eb4c1a69a@redhat.com>
Overall Series Review
Subject: drm/virtio: add timeout to virtqueue wait to avoid hung task
Author: Ryosuke Yasuoka <ryasuoka@redhat.com>
Patches: 7
Reviewed: 2026-05-16T13:58:17.315172
---
This is a single patch addressing a real syzbot-reported hung task problem where `wait_event()` can block indefinitely in `virtio_gpu_queue_ctrl_sgs()` and `virtio_gpu_queue_cursor()` when the host stops processing commands. The approach — replacing `wait_event()` with `wait_event_timeout()` — is a reasonable direction, but the patch has several issues that need to be addressed before it's mergable.
**Key concerns:**
1. **The 5-second timeout is arbitrary and can trigger under legitimate load.** A busy virtio-gpu host might legitimately take more than 5 seconds to drain the queue under heavy load. This would cause spurious `-ENODEV` errors and dropped cursor updates in normal operation. The commit message says "consistent with the existing timeout pattern in the driver" but doesn't cite which existing timeout it refers to. A more robust approach might be to integrate with the device-level health checking (e.g., only bail out if the device has actually been unplugged/reset, or use a much longer timeout).
2. **The `goto again` placement after timeout is correct but subtle.** If `wait_event_timeout` returns non-zero (success), execution falls through to `goto again`, which re-acquires the lock and re-checks the condition. This is correct behavior — matching the original `wait_event` + `goto again` flow — but the diff placement makes it easy to misread.
3. **No logging on timeout.** When the timeout fires in `virtio_gpu_queue_ctrl_sgs`, the driver silently returns `-ENODEV`. There should be at least a `drm_err()` or `drm_dbg()` message so the failure is diagnosable — especially since this path could trigger spuriously.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 3:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 8:59 [PATCH] drm/virtio: add timeout to virtqueue wait to avoid hung task Ryosuke Yasuoka
2026-05-12 8:59 ` syzbot
2026-05-12 8:59 ` syzbot
2026-05-13 21:40 ` Dmitry Osipenko
2026-05-13 21:41 ` syzbot
2026-05-13 21:41 ` syzbot
2026-05-13 21:54 ` Dmitry Osipenko
2026-05-16 3:58 ` Claude Code Review Bot [this message]
2026-05-16 3:58 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-overall-20260512-virtio-gpu_wait_event-v1-1-207eb4c1a69a@redhat.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox