Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1518214pxk; Thu, 10 Sep 2020 18:17:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOtmRY6If3cB2O/kzA1kErw1ycg0thMRu7Hn/ZAzm/JXmgulkqYHRANFaMgAkB+4TrnH7g X-Received: by 2002:a17:906:d78c:: with SMTP id pj12mr11581047ejb.36.1599787032208; Thu, 10 Sep 2020 18:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599787032; cv=none; d=google.com; s=arc-20160816; b=fHWlmRddq2Mz+WbjsLR/KDXMf7XGRRSzd0h18jjTyOiLf/FFJB3VnpYsTuhkOZrDBZ FQdaa5G2henYTkNqZCw2pPz6o1iRezuMKpaQbWyG2jGbdPCBgCwjbN2xWQSG/vWDm/xr hb1EeiEGXzeEcwuufD7CFFQjBlVTDESEPCiAuxsmDnoUzCAVbvY/CSp9S2JpVuwi+tvc 5x283UMtHKPEHCfDvjZcaUbARQfXcqck/rQOVgG0wt5obnd/cHa0LfKqwoQSaWc3u9fF dK5Aq21D7jE3Ycv3meuc8JkuBB7zIqjIrbuh8NA6gJyyggaV4XVKG/M2fdu3L5YXyOc7 EypQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=81nqI0nDx3f13i63x9x/ZMdWIxuz1cNDggFR/GnHZWg=; b=a1M0LkxgphYJquTMI1xk1H8i4z/Fq7oT0yyef27FVcu4/lEToATxRjrZrs6RYJHphH qE4GCWBksUOHRTZ6kGc6BPScTrHxPfLOFu4iC20itjKN0BwnE4ALCIWoYFTGefMgnDlV yDq+RD/yCVn3Oz76CkQlg5YrzYvKyamCEaFGoESd8C9iA4MN2eDWtuD9CMmb0OqbOQWA fXGfmL37Tym+NPA7Fl6ayqlA89fvSEDgm9tfF7hCL4sNAE9DWd5mZ2+Pf8bIPd8ueyeK +CymcPiGSVOs0S77SL6MuGugd3QTsJV5LykMBNnMTaMUkOGRJs9t/pd1qBGUM9D7U1XK Y2Tw== ARC-Authentication-Results: i=1; mx.google.com; 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 b5si240001ejq.317.2020.09.10.18.16.37; Thu, 10 Sep 2020 18:17:12 -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; 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 S1725550AbgIKBMK (ORCPT + 99 others); Thu, 10 Sep 2020 21:12:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgIKBMJ (ORCPT ); Thu, 10 Sep 2020 21:12:09 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E5EAC061573; Thu, 10 Sep 2020 18:12:08 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGXbh-00E2kB-Ba; Fri, 11 Sep 2020 01:12:05 +0000 Date: Fri, 11 Sep 2020 02:12:05 +0100 From: Al Viro To: Jens Axboe Cc: linux-fsdevel , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] pipe: honor IOCB_NOWAIT Message-ID: <20200911011205.GG1236603@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 07, 2020 at 09:21:02AM -0600, Jens Axboe wrote: > Pipe only looks at O_NONBLOCK for non-blocking operation, which means that > io_uring can't easily poll for it or attempt non-blocking issues. Check for > IOCB_NOWAIT in locking the pipe for reads and writes, and ditto when we > decide on whether or not to block or return -EAGAIN. > > Signed-off-by: Jens Axboe > > --- > > If this is acceptable, then I can add S_ISFIFO to the whitelist on file > descriptors we can IOCB_NOWAIT try for, then poll if we get -EAGAIN > instead of using thread offload. Will check. In the meanwhile, blacklist eventpoll again. Because your attempts at "nonblocking" there had been both ugly as hell *AND* fail to prevent blocking. And frankly, I'm very tempted to rip that crap out entirely. Seriously, *look* at the code you've modified in do_epoll_ctl(). And tell me why the hell is grabbing ->mtx in that function needs to be infested with trylocks, while exact same mutex taken in loop_check_proc() called under those is fine with mutex_lock(). Ditto for calls of vfs_poll() inside ep_insert(), GFP_KERNEL allocations in ep_ptable_queue_proc(), synchronize_rcu() callable from ep_modify() (from the same function), et sodding cetera. No, this is _not_ an invitation to spread the same crap over even more places in there; I just want to understand where had that kind of voodoo approach comes from. And that's directly relevant for this patch, because it looks like the same kind of thing. What is your semantics for IOCB_NOWAIT? What should and what should _not_ be waited for?