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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80AE2C4BA2D for ; Thu, 27 Feb 2020 12:37:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5609C24697 for ; Thu, 27 Feb 2020 12:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582807077; bh=LYndjluasFvOwT9cS111JQlMY4yrNHQvHvqjIBLUJgQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=QErcMx4G7nW45OrtH7hgzWYrh9VneyilPy06Z2TUpvKkpl0oTXoFOdX6UhJfbGl45 H+oKzh5k7wNIwv5U99buoO1Qb3cyfe8tT9hLhR17ZGKXE/MhQ6N29pz7WuCfYhStRM MZzQd8iWKPnJXR2XakRB69TsSnlIRWlO0gea9I+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729030AbgB0Mh5 (ORCPT ); Thu, 27 Feb 2020 07:37:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:36302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728982AbgB0Mh4 (ORCPT ); Thu, 27 Feb 2020 07:37:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EE3124692; Thu, 27 Feb 2020 12:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582807075; bh=LYndjluasFvOwT9cS111JQlMY4yrNHQvHvqjIBLUJgQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UDe5pD7Wm98QR+Duu+FR746o0EA24PTZ9S8Nsjv46813sLABQri45IwXqVox/7iDZ uQGs/RrB77tuiAMtSx9TNf0oqrcTaw+AGXh7lViF5zaXHFjNyMoEkJ1ZcVOosaV+GJ BsR/ZHsbnLG/c4Hog5WKQsjcNFXy4Jx+EAYenlVs= Date: Thu, 27 Feb 2020 13:37:53 +0100 From: Greg KH To: Stefano Garzarella Cc: stable@vger.kernel.org, io-uring@vger.kernel.org, axboe@kernel.dk Subject: Re: [PATCH 5.4] io_uring: prevent sq_thread from spinning when it should stop Message-ID: <20200227123753.GC962932@kroah.com> References: <20200227104311.76533-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200227104311.76533-1-sgarzare@redhat.com> Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Thu, Feb 27, 2020 at 11:43:11AM +0100, Stefano Garzarella wrote: > [ Upstream commit 7143b5ac5750f404ff3a594b34fdf3fc2f99f828 ] > > This patch drops 'cur_mm' before calling cond_resched(), to prevent > the sq_thread from spinning even when the user process is finished. > > Before this patch, if the user process ended without closing the > io_uring fd, the sq_thread continues to spin until the > 'sq_thread_idle' timeout ends. > > In the worst case where the 'sq_thread_idle' parameter is bigger than > INT_MAX, the sq_thread will spin forever. > > Fixes: 6c271ce2f1d5 ("io_uring: add submission polling") > Signed-off-by: Stefano Garzarella > Signed-off-by: Jens Axboe > --- > fs/io_uring.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) thanks for this, now queued up. greg k-h