Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp793494pxb; Thu, 17 Feb 2022 15:06:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZUP/7IfaRxgWh8b0IrPoNWvG5zlmLgsjp0QuxQD/rBNmZoku6X28yhUyPnCGHVb74j1++ X-Received: by 2002:a17:90a:8048:b0:1b9:55dd:b72d with SMTP id e8-20020a17090a804800b001b955ddb72dmr5331639pjw.90.1645139160843; Thu, 17 Feb 2022 15:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645139160; cv=none; d=google.com; s=arc-20160816; b=raKnx5HC/Hp0z2+flCUnGyOrZBXZIdn+W4+pUdiGJVbYmayjIJ+rnZXwiVcr7tYyb/ Jc9Sivuh5svSGj584aMKut5t3fONXcsbH0vaOxCDiaAPzH6cD1cehvg+sSKMHFOSqL7r Jyf+yVkPe0O7StF+XFV7Cs2jB1YJmCVjI8MMjMTELVcSb/iqw4hruSTCWbe3qzkU+t4N vsDv+CRKPQ08Iu/wDpHrBbrQBGDkcoauL1lMzFKnx3Zo4/vN34eC1w0ttbdPwk9XmH/Q 7lMTVtTPOuy9DIHWP3DpFsC0FUjEm+OLwsGfNE+Mt7oecwyvnzFuEkkwD0lovzVEThg4 185A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:message-id:cc:to:from:date; bh=Y4LTaNVi6GWq8GeKmiSuJVBv4vHYFUBmOJh9IB5E/Bo=; b=QlqjYmJutBJsEgPeb+ChSvHPwAzPVZTwVM2poYTtjlKamKLlAfC1SmxX5Leso/aQ82 Lzb01DX6Cq2ama5DHvdPjGLiO/HjUhFcXHkWJTSkg90lbT0DWr5A113UteuigF3RC9XU CU0UFUrSGX2ZPSXZxBoQMyc3VekhX9cpuDj8kac+fjZyozsLXF/2cdtG7G/Du3ISWA1q uDpxuX7t+sqH/oigr2K6DSJM6wzGIw01qaNwDnGx2kZmzr5rykJkE41ECO80UwGtQs0o +QzO8djI7RNC9n1t/a9UKK7JDqNsZjpMcIVfkXLJX2G3UoNDVMNRE/iFQjG9TeQNlDBY cIvg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c8si10392314pgq.293.2022.02.17.15.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 15:06:00 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9527B11861B; Thu, 17 Feb 2022 15:01:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242471AbiBQTuB (ORCPT + 99 others); Thu, 17 Feb 2022 14:50:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232902AbiBQTt7 (ORCPT ); Thu, 17 Feb 2022 14:49:59 -0500 Received: from cloud48395.mywhc.ca (cloud48395.mywhc.ca [173.209.37.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 979C942ECE; Thu, 17 Feb 2022 11:49:43 -0800 (PST) Received: from [45.44.224.220] (port=39850 helo=localhost) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nKmmc-0007F8-77; Thu, 17 Feb 2022 14:49:42 -0500 Date: Thu, 17 Feb 2022 14:49:41 -0500 From: Olivier Langlois To: Jens Axboe Cc: Pavel Begunkov , io-uring , linux-kernel Message-Id: Subject: [PATCH] io_uring: Remove unneeded test in io_run_task_work_sig() X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid testing TIF_NOTIFY_SIGNAL twice by calling task_sigpending() directly from io_run_task_work_sig() Signed-off-by: Olivier Langlois --- fs/io_uring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 77b9c7e4793b..9b320b5f158c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7683,11 +7683,11 @@ static int io_run_task_work_sig(void) { if (io_run_task_work()) return 1; - if (!signal_pending(current)) - return 0; if (test_thread_flag(TIF_NOTIFY_SIGNAL)) return -ERESTARTSYS; - return -EINTR; + if (task_sigpending(current)) + return -EINTR; + return 0; } /* when returns >0, the caller should retry */ -- 2.35.1