From nobody Mon Jun 8 16:28:12 2026 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88685315D33 for ; Wed, 27 May 2026 23:38:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779925121; cv=none; b=K3TLhujOFEKqDvUUp9tB0EMxQ4U3MOIi3VA6S3SVLCAcBBBPMqWoI+oiDe2RmzR/4TCD+U4E0kIq/P2mtpru+xk8EZLXQAFZ9KI+z/QOKme+ly4c6tiGxQVjm0WgcSPgW0xAk6dhwue8BxaIIij9KYe8stLDoU+aS6w7UP0AYeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779925121; c=relaxed/simple; bh=PkptWrZGxgy2DlIYSQdSo0PHUl2Qjl+gZmrb8ItFf5U=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=FmV0jijzMZcoZGJAyh+bV/TaV51sbdEBCEeJJbOaBd7lF0IybnSo6TYCveSnXYKEMRQnItMuSmN4upxEBFpKyvbeyHHQRCv8oQOs6rq9VqAj4hv9iYj6mh1cIX+5GOe3xk5K0vzaBQu30krE6e9MPB9IWcf3QaEiXwSfmCzCbso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-69d8e718acbso6005778eaf.1 for ; Wed, 27 May 2026 16:38:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779925118; x=1780529918; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YuGhcVjCsqfRUDyzRMPRfqGymiH39O3C1IWGRhrhT40=; b=gm7ruseuh44EOoagvtzs0naxs6wSwEuj24RjirO7CxxKaOLRxyw8f2s9Gu2+wGcM0n b+i9sA1YPNGFLDEf3u2b8MnWX9G30RQQPwoQD4sSpRwVRPyG+CNZcg/cRr8gtdauoCJZ lpc/qCWcx7iK+Mievoc32Us2XB4L7RNFONPHrVKaW7os+TMH2dz7UnaeZ9uQ2cZnXz1S ng0kcGvOQ1lKZzJ4Bbcz79qbXxgkRzJrYnh57TMa0CC0IesM8NGHGM7ccVwVijwkYMrs IJxuZmTKCS4nxfVfjX0C4/u7BTb6Z3gm+n3MElFbMoiyPTJHpQEi4P3K9ti2Tn44ytJf dVdA== X-Gm-Message-State: AOJu0YzMuQLD/Igv2iTCbftAocSJM4f7TPKMfF+AmG3SrpaNaLWPJ0Dd YRMOuWheE//4PyjKL5oZn8rtTPlI4VTbdMib7D840wYF9EpZpP60SAghjCCnuQa+eagqAWzDkZu f4IStPqAn0eO606ShhkGH8dS6odt4zmPvG1I9hhkJZCkj5zp+qCS6ij8EYhs= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:1844:b0:69d:c0a9:c1a5 with SMTP id 006d021491bc7-69dc0a9c776mr6960449eaf.27.1779925118640; Wed, 27 May 2026 16:38:38 -0700 (PDT) Date: Wed, 27 May 2026 16:38:38 -0700 In-Reply-To: <6a150a33.2b0a0220.185dbd.0006.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a17807e.0857bdf7.9cede.0001.GAE@google.com> Subject: Forwarded: [PATCH] The hung_task report shows multiple io_ring_exit_work From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] The hung_task report shows multiple io_ring_exit_work Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master This debug patch instruments io_sq_thread() to identify which segment of the main loop is failing to release sqd->lock. It adds rate-limited pr_warn() calls at five points: - around __io_sq_thread() to catch a wedge inside io_submit_sqes() under ctx->uring_lock - around io_sq_tw() to catch a task_work callback that doesn't return - on the full loop iteration to catch any other slow path - on the SHOULD_PARK-set-but-still-looping condition, in case the park flag is being missed - at io_sqd_handle_event() entry to confirm which sqds reach the park handler Thresholds are 10s (per-call) and 30s (per-iteration), well above any legitimate SQPOLL work, so a healthy ring will produce no output. Not-Signed-off-by: Deepanshu Kartikey --- io_uring/sqpoll.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index 46c12afec73e..26f88b485cfd 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -246,7 +246,8 @@ static bool io_sqd_handle_event(struct io_sq_data *sqd) { bool did_sig =3D false; struct ksignal ksig; - + pr_warn_ratelimited("sqpoll-dbg: handle_event entered sqd=3D%p park_pendi= ng=3D%d state=3D0x%lx\n", + sqd, atomic_read(&sqd->park_pending), sqd->state); if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state) || signal_pending(current)) { mutex_unlock(&sqd->lock); @@ -333,6 +334,8 @@ static int io_sq_thread(void *data) while (1) { bool cap_entries, sqt_spin =3D false; struct io_sq_time ist =3D { }; + unsigned long iter_start =3D jiffies; + unsigned long t0; =20 if (io_sqd_events_pending(sqd) || signal_pending(current)) { if (io_sqd_handle_event(sqd)) @@ -342,14 +345,22 @@ static int io_sq_thread(void *data) =20 cap_entries =3D !list_is_singular(&sqd->ctx_list); list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) { - int ret =3D __io_sq_thread(ctx, sqd, cap_entries, &ist); - + int ret; + t0 =3D jiffies; + ret =3D __io_sq_thread(ctx, sqd, cap_entries, &ist); + if (time_after(jiffies, t0 + 10 * HZ)) + pr_warn("sqpoll-dbg: __io_sq_thread stuck sqd=3D%p ctx=3D%p ret=3D%d f= or %ums\n", + sqd, ctx, ret, + jiffies_to_msecs(jiffies - t0)); if (!sqt_spin && (ret > 0 || !list_empty(&ctx->iopoll_list))) sqt_spin =3D true; } + t0 =3D jiffies; if (io_sq_tw(&retry_list, IORING_TW_CAP_ENTRIES_VALUE)) sqt_spin =3D true; - + if (time_after(jiffies, t0 + 10 * HZ)) + pr_warn("sqpoll-dbg: io_sq_tw stuck sqd=3D%p for %ums\n", + sqd, jiffies_to_msecs(jiffies - t0)); list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) { if (io_napi(ctx)) { io_sq_start_worktime(&ist); @@ -358,6 +369,15 @@ static int io_sq_thread(void *data) } =20 io_sq_update_worktime(sqd, &ist); + if (time_after(jiffies, iter_start + 30 * HZ)) + pr_warn("sqpoll-dbg: loop iter took %ums sqd=3D%p park_pending=3D%d sho= uld_park=3D%d sqt_spin=3D%d\n", + jiffies_to_msecs(jiffies - iter_start), sqd, + atomic_read(&sqd->park_pending), + test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state), + sqt_spin); + if (test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state)) + pr_warn_ratelimited("sqpoll-dbg: SHOULD_PARK set but looping sqd=3D%p s= qt_spin=3D%d\n", + sqd, sqt_spin); =20 if (sqt_spin || !time_after(jiffies, timeout)) { if (sqt_spin) --=20 2.43.0