From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379511; b=na/JLNTzepuGzM5EpvGbO869bF1G9LIPt1khL1P6O2Rj2/1rReSBsYY4ayiRPGUqw7Sf T50Vde+zydAtZZIwwB2T/oOPaePrxBFd86WkcMAmqhdwj/FMssQLf9KNR/Q1JWMbBirmY aI+nXNNr5PrfgjovJT831Gk7I3YNYBT1DNGw2uQlUgWSynKvM0aW4vStF+c+VR+3543W8 wnITutz29k8Fgt9BeMcO+HIYJidAAjtDISSS0mYpCctALqTJ1kooFfeQdJQiFk/HSNwOQ hmYHUVFwWLlChWGF0XZYJpkGy5xhHASP6dk+2zWDzSB+iiv3kFXcv7E/FSyc387DL7g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379511; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=sb9CxIwxrXz9C0UFVZulI+eXCNTlJOxC64P6taEts0c=; b=OLJnaDgle4P3KloCzqHTrYBjytuVlvkaXvICQtpuRvQwX1j/Uji2yW6gOxXsULhk3YSA 6iI6s8fHiQ07Ad4Ykhn9QOSsOLsdWe57ubbNjfslbVbJD5QcMdcf/E4l2wDJFCdr7aOCd 7VKkINMOAiZ0unt1oBVwRNTiaw1dqbAF1eNz5cl5TvWltjDXntJbRenLrft6+OOwKB7uq lszhkAYu4o2qZyqZ81tN73jjOuOKOFB+LMmr6yO9V0K9TtmcZd/G90+80tK0K/pHsQOyS AwxOWnoMzy/mQBIEswZCRXlWVmc8S857TiON026QwXLj4WSUUYxhUJoXKWk+79W1mqw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SOyMXcjV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A153606A322; Fri, 4 Dec 2026 10:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=SOyMXcjV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88FE21F000CE; Fri, 4 Dec 2026 10:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379511; bh=sb9CxIwxrXz9C0UFVZulI+eXCNTlJOxC64P6taEts0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SOyMXcjVAXag3dKGLNCOwDS8MMI5woTTNlQuAYjoT2P4oyq2R+WR2V5QMcNu3jjMh QoQvOT0fMivmRRKbEVu8IdZg1Kdprw4F6hSJPcDZxhbACZLF05mv0Aa4w02nfWg3rN L3QiDDYwcOMTB+AzJiIz5JsyD7Wi99l3hFTBwtKQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0024/1167] io_uring: wake SQPOLL task when task_work is added to an empty queue Date: Fri, 4 Dec 2026 18:50:51 +0900 Message-ID: <20261204100702.675159068@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe Commit 78f9b61bd8e5466f0e90823e64e3d87c41f6258c upstream. If there's no current work on the list, we still need to potentially wake the SQPOLL task if it is sleeping. This is ordered with the wait queue addition in sqpoll, which adds to the wait queue before checking for pending work items. Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately") Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/io_uring.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 3fd27002f4f7e..895011a3d8ce3 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1409,8 +1409,13 @@ static void io_req_normal_work_add(struct io_kiocb *req) atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags); /* SQPOLL doesn't need the task_work added, it'll run it itself */ - if (ctx->flags & IORING_SETUP_SQPOLL) + if (ctx->flags & IORING_SETUP_SQPOLL) { + struct io_sq_data *sqd = ctx->sq_data; + + if (wq_has_sleeper(&sqd->wait)) + wake_up(&sqd->wait); return; + } if (likely(!task_work_add(req->task, &tctx->task_work, ctx->notify_method))) return; -- 2.53.0