Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3234902ybt; Mon, 22 Jun 2020 19:21:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyraSqXEoVTinRjU8peSLu6hybEojnADxwDrQKXzZl4qI6BKNWCDodQghVKxkcEAlI7cYrg X-Received: by 2002:a50:ee01:: with SMTP id g1mr19063556eds.44.1592878917945; Mon, 22 Jun 2020 19:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592878917; cv=none; d=google.com; s=arc-20160816; b=CCm6Dp7lscj4W88/cxeAWSet6y4R6PDKQY/kYvQInd5Lr6bxjEXh4KtyZOuJaGqoha Mrg4IPFOFVikmbd/E+fMlBT4JSk87DZe41cZHYItcdUqruBEVul7mYeKTsgt0KrdOUwl zP6Eu84tMGWWDf/MYEiWeymP/lBBsQ/ZNMC3RkBJJPMFYyzr6dJxAX6z8V3TCPuaxWG5 GR0CS1hLAVL4MTpZrZkqLB4RPqCGwFoDNJLNDbTx8Piwzkz8dgnB8cVq0NYHyQ/TLqOr leFt0QlSGxb8Kvc4E1++mGVvqB0JHAL6Qnb8OnT6YaF85vjCWTyO4fZvKqW7nLnWPQQQ Jtug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:to:from:subject:dkim-signature; bh=kLZjBPtHSAXfJtA8Ix/wp7Lto4xpgPzVeFE7SLHRWeo=; b=Lt6Rl4I2f6DOfurH0W9VjOAwHUzLzeyms+tgy3DUhz7vZ2Ea+zvjfjyVPWuQcs7QS7 rM2LBeChO30GQgSphVg5pdfwdrRBWIge3GPfhToJ4ebpQRE4ViBEQtKgEzwO/kQTRobt 49kMza5RZEBJ6XMbaDWhn0P+J6iUA5WBf9VCyh1+iLc/kVdmP27CmK81MLgbHJOs8+SE 2ZfW8mmAc0h+IrZrqn7WUEoZrWNsMGj/68KuTRD06nQOEcLgmssIth2HrJVrk2hK87uU ryEav+MTfXhxEPdpUEF0RzrfOGeFR3gGqHLiBmU9B6stut1ess+PQw1HcULQ7Xgx6Vb9 OHQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ioju6TH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si2121732edq.225.2020.06.22.19.21.34; Mon, 22 Jun 2020 19:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=ioju6TH5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731140AbgFWCSw (ORCPT + 99 others); Mon, 22 Jun 2020 22:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728447AbgFWCSw (ORCPT ); Mon, 22 Jun 2020 22:18:52 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D2DC061795 for ; Mon, 22 Jun 2020 19:18:52 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id k1so8460854pls.2 for ; Mon, 22 Jun 2020 19:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=kLZjBPtHSAXfJtA8Ix/wp7Lto4xpgPzVeFE7SLHRWeo=; b=ioju6TH5Ffu+9KU8EwCkPcqaRyk9IoHJABxfa3QEOddQbV7mkY6JLK4ru+UX7432PU Oe/Xz9XjEXXvCq06scF5oYKTL0/fu2vgy0Wbi//raQBuDzKX/PeaPp6I1DKC74yhKBez u5iM4eo4iOHNbl5CFz7iBeRfc54FsawgydJChyaB6YfT1TFKtzXjkJ0sViTuZ+lxW965 oMr7KKvpgfG86b5L2euFIiTXTBL3jF6/rUHv0eSJKg/wSygVy+EKfre1pzkFEvXCZ9rd 9nfxz9//oFsrPUSvr2NJkZ6cAjJdPpi/16lw2F8j6TgRX4fj8Aeh6qPcYu3pq3YPiFu6 abdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kLZjBPtHSAXfJtA8Ix/wp7Lto4xpgPzVeFE7SLHRWeo=; b=HXZ47639vg+BzTQ2cQJJnNyKXFdnpCMgOd3zqJGN2sytA6qmTy8yzuuzbNZ1Y4ucvU ujGgLeZ39PzWZTSUJTRTjE8EGtBNbJSM7UB9INpKNocRcxT9sHYKcCXswaL7+W52dekN rbEf+u372kv3hcQhNZFf9J01VvYRntRjozNmmFvEh0W+koACYbY6OWSCVw+PMMkeycji 8Vce7p3UtJOfItCrn0YynGneGlLsicIt70s3dhgkAyXzFQlVoQijXrffrkkKDs7h2ugh TK/vxvAI+8aOvbvRSaFyeheD+kbB0nok0j8bW/5UOYWSLEgqD1VQ+ws10yUfTWmuH0We ymgQ== X-Gm-Message-State: AOAM531RuFgo1grzn5eSFi05MPwutIPr7TQlUNhs10L/iRZQV9V5WVRT 1BMv8CB295yHRkgfSSb0ayoFgT5JGWU= X-Received: by 2002:a17:90a:be09:: with SMTP id a9mr20404009pjs.43.1592878731390; Mon, 22 Jun 2020 19:18:51 -0700 (PDT) Received: from ?IPv6:2620:10d:c085:21e1::136e? ([2620:10d:c090:400::5:30d1]) by smtp.gmail.com with ESMTPSA id u14sm16299612pfk.211.2020.06.22.19.18.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jun 2020 19:18:50 -0700 (PDT) Subject: Re: [PATCH 1/4] io_uring: fix hanging iopoll in case of -EAGAIN From: Jens Axboe To: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <0301f35644823a01cbae87e440df7d58ebcf2279.1592863245.git.asml.silence@gmail.com> <95b720a6-926c-a208-e929-1d0203fa8701@kernel.dk> Message-ID: Date: Mon, 22 Jun 2020 20:18:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <95b720a6-926c-a208-e929-1d0203fa8701@kernel.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/22/20 8:07 PM, Jens Axboe wrote: > On 6/22/20 4:16 PM, Pavel Begunkov wrote: >> io_do_iopoll() won't do anything with a request unless >> req->iopoll_completed is set. So io_complete_rw_iopoll() has to set >> it, otherwise io_do_iopoll() will poll a file again and again even >> though the request of interest was completed long ago. > > I need to look at this again, because with this change, I previously > got various use-after-free. I haven't seen any issues with it, but > I agree, from a quick look that I'm not quite sure how it's currently > not causing hangs. Yet I haven't seen any, with targeted -EAGAIN > testing. Ah I think I know what it is - if we run into: if (req->result == -EAGAIN) return -EAGAIN in io_issue_sqe() and race with it, we'll reissue twice potentially. So the above isn't quite enough, we'll need something a bit broader. -- Jens Axboe