Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2192776iof; Tue, 7 Jun 2022 22:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1XI+faI8nqWbA9fQiWkpLTzacquOIJ/vilpwQTI3U4EXiW39cTuVHOgG252zPBLVlP/Yn X-Received: by 2002:a17:903:244a:b0:167:74f3:7463 with SMTP id l10-20020a170903244a00b0016774f37463mr15720426pls.44.1654667145126; Tue, 07 Jun 2022 22:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667145; cv=none; d=google.com; s=arc-20160816; b=Bn0laPblLN4FeLbKCHWh6jbHMaadVI80cBknrMMidQiMCyXfm3b90+kfx0QzjnfY4y YxBWn2lvsC/17azy1fImFICSHsLNJBTaYVNaLmmOuIOW0PMl2LVIyi0HdvAUT43LCF6/ U9EUKcLovf0nsoH9032NMRdOoI8rceXycv+vw95bP7bT0y7UEzWLsEo084YaIKFyYifb cc7UgmWW4EnfW8t6h8Y3GxvGgr/X24ZaQ+osCYzMZ8vP6wihG2bBjdVO2u+tOz7M5qK6 Pwq4C33ooS5jZ8THCNdWLpf1BKRWLG1QoLeiFdkF0vqixsCsYEZwz48Y4uc4n96Q2P+Y DsVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TZlR5PclCJSoNecske377yQccFsh623dp+xyDF/IEvg=; b=NIFCRLAzIONNoCz1aTUhzgB82G4XcXhgMatPTiboH4mZDx4s8y/HnTgojnuLSkxHoI Z2K8wNorMMrjJQcnK9aSmHzC00Wd64h8/1nQ6+IWM1p6ztIje2JwETOYWv2qWh4+WjYp 9YLmPNbd/9ApsBZcBYTN6TJxOJn4bAy7WFVDfi7W7qZ9rpVfAzcwMh+SSTvU8gEqQQUC MazkK2ka7UYSJuTnAlxQKiX7quvKW0M4nH5we9WJFDOg+A+sc78Ppe6y/gBqUqw+n1Dz ghoHa7JRCoGkwM0Le/hwFJDPial2BDyBg8XRwlVeTVTWamODBA2De3IlvMz9j5Pgftal mKmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wlZdF7Pd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n14-20020a170902f60e00b0016763dfce14si15310757plg.35.2022.06.07.22.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:45:45 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wlZdF7Pd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F7AE3CC594; Tue, 7 Jun 2022 22:10:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356158AbiFHAOY (ORCPT + 99 others); Tue, 7 Jun 2022 20:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381996AbiFGVs7 (ORCPT ); Tue, 7 Jun 2022 17:48:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21ECD23B14A; Tue, 7 Jun 2022 12:08:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6EB5A61768; Tue, 7 Jun 2022 19:08:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7621BC385A2; Tue, 7 Jun 2022 19:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628901; bh=dviQHyfJknwjpGclzL9roUsZMacgJUPtVdHbwAS164k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wlZdF7PdoZs88r6mOB0B8TYLjkX381n1i/pJa7+bBdpuLFU7yF8b1FgJkFJ5FqLbQ hIiNHwD7xGesdDtIfXSBsMDXycuOwFWvLbIPs+9LuqFP777D16rhDmUOv5hk7WGuj1 8qxfTKDgxOxj/TnkoD4uIxRXd2WSOEAGVJoN8D3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.18 460/879] io_uring: avoid io-wq -EAGAIN looping for !IOPOLL Date: Tue, 7 Jun 2022 18:59:38 +0200 Message-Id: <20220607165016.226482566@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Pavel Begunkov [ Upstream commit e0deb6a025ae8c850dc8685be39fb27b06c88736 ] If an opcode handler semi-reliably returns -EAGAIN, io_wq_submit_work() might continue busily hammer the same handler over and over again, which is not ideal. The -EAGAIN handling in question was put there only for IOPOLL, so restrict it to IOPOLL mode only where there is no other recourse than to retry as we cannot wait. Fixes: def596e9557c9 ("io_uring: support for IO polling") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f168b4f24181942f3614dd8ff648221736f572e6.1652433740.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/io_uring.c b/fs/io_uring.c index e0823f58f795..7272e410d24a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7327,6 +7327,8 @@ static void io_wq_submit_work(struct io_wq_work *work) * wait for request slots on the block side. */ if (!needs_poll) { + if (!(req->ctx->flags & IORING_SETUP_IOPOLL)) + break; cond_resched(); continue; } -- 2.35.1