From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 717ABCA0EC0 for ; Mon, 11 Sep 2023 21:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350339AbjIKVhE (ORCPT ); Mon, 11 Sep 2023 17:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239504AbjIKOWX (ORCPT ); Mon, 11 Sep 2023 10:22:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E182DE for ; Mon, 11 Sep 2023 07:22:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3537C433C7; Mon, 11 Sep 2023 14:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694442139; bh=KHOx9Dd2c/wiFxa7GJlfcGoxUSZLechfLR7PvFjbdrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqXIHKAihH/MiqI61v8JlEQ2V7lXAY3kMGL3yAX5d8OX+5ooTabYVGsjLKrVQ1ZYb s6SFSFYrJJF1jvzGFNrJy794KDx+m90d9tR1cWafZ5oO3QnLPedFyt6OkvgF516DEE 1mXIGGcLo+tUocZPL98FRrOzHWcFfDshF4KI/RUk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pavel Begunkov , Jens Axboe Subject: [PATCH 6.5 659/739] io_uring: break iopolling on signal Date: Mon, 11 Sep 2023 15:47:38 +0200 Message-ID: <20230911134709.516294110@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pavel Begunkov commit dc314886cb3d0e4ab2858003e8de2917f8a3ccbd upstream. Don't keep spinning iopoll with a signal set. It'll eventually return back, e.g. by virtue of need_resched(), but it's not a nice user experience. Cc: stable@vger.kernel.org Fixes: def596e9557c9 ("io_uring: support for IO polling") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/eeba551e82cad12af30c3220125eb6cb244cc94c.1691594339.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- io_uring/io_uring.c | 3 +++ 1 file changed, 3 insertions(+) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1673,6 +1673,9 @@ static int io_iopoll_check(struct io_rin break; nr_events += ret; ret = 0; + + if (task_sigpending(current)) + return -EINTR; } while (nr_events < min && !need_resched()); return ret;