Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4585124imb; Wed, 6 Mar 2019 17:39:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxLrQzLzGr+KIhX6uxuJa4zozUIBZYiRxeOK+tN6hlMYVF+cSEup5+gMgude6yFVrAVnCQ7 X-Received: by 2002:a17:902:1008:: with SMTP id b8mr9873389pla.120.1551922751043; Wed, 06 Mar 2019 17:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551922751; cv=none; d=google.com; s=arc-20160816; b=gbjKRIDop5nWROTCm0ei4vaXwCho46PlWDHXMJ1u/9NbemvZYmvET/64IBk9HnmQvr /hDQSMAlhGggXwDSFqSlPCCxCWY2QzQKF7YUqFWTW/CYneBJaALfX5126SW/KK2g9POL L1JvVsGgXqW+XxYIc2rWPnP19qGo9wx78Mo5yfYGFd8+4sk6R7X4bLFvzq30Iy+caN41 pesD+KHcJw2uuBcoRu0OQoTri81mu+qM1CNaROBQWJqVwsYUIQY6OywxKkoPGtsveL2w ofQDVuOoPO9ZjOP13CNHGjLJ01qT3W5YVB0wQHYrBEfkjFJk6+YpMikXRCvQvfVMnqVa Uhdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=P/h54bn5MUqgO8FxqLvtxQ5ssyd4D+ngpXlcxoit0L4=; b=KiOkzJ8SHsTicY7b0JtSQbj7vv43Id2Yn5c16Am01nf9NcA6G0bOpiO0EPRHmqSJt8 iJB6Ri6Lmycp761f9OsafvA0EbVBjBnrP41Ji1mxtUp9n3Y1muZIJIBWNL22LAxCDGUI gArtIM28DfwbBpNGMcyu9bLVQ4w/WFgJx9jQbIT3th+gs7FDobkJTe8/broWeiX9RVMh cjBH3+8sNQsSjPkgjiXIlZ9uJ3C01CKBnK/evjEdAhvZ2sjhSfC3OhqLfG6BOPPPS5+M xCfTAvqzNNxG4sz1L0F8F5v6vhhkrtBZ//hREQEM4t1Ey91zUtLbUvzHaXDXshlOCBTU GgUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QIlqE2Om; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e67si3125016pfh.212.2019.03.06.17.38.55; Wed, 06 Mar 2019 17:39:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QIlqE2Om; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbfCGBib (ORCPT + 99 others); Wed, 6 Mar 2019 20:38:31 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38843 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfCGBia (ORCPT ); Wed, 6 Mar 2019 20:38:30 -0500 Received: by mail-lj1-f194.google.com with SMTP id 199so12720797ljj.5 for ; Wed, 06 Mar 2019 17:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P/h54bn5MUqgO8FxqLvtxQ5ssyd4D+ngpXlcxoit0L4=; b=QIlqE2OmvvilcYZJhkOscLXVK3QSOpv4YwowoAMEUvrv9dE+ucGLDbOoWzrBw6Bx0U IjFWLlk5FlJtQmWhfxbYFePRQY/V8qm4UdJ9io4+PDRZ18DIgqmb8qnmd7eXlI6WA8rL OxmgCN9S4rA8BW/SmJqXJtSkXuRatASti6BEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P/h54bn5MUqgO8FxqLvtxQ5ssyd4D+ngpXlcxoit0L4=; b=X70VIypnVRSYmlJGsC0RLCiLmDKeLvAHkOdt8d/QeKDw1QZFKOJGnnU+sTU1lF9uRF rW1k3QBcxKcBXqJfX6EoFJn/jYVjMtHvUo2RSMBBBcoQFiTLAika9CkjHOPRCskUKjhI K3IHu0YhAvXOT1nr0pu+yhn824rFHoPxq6rTUacqRoWNJJsalj6prchFrznEDAl8EJn5 4xXlyvKI87//TsaSmvCjc26fMMPRCPjW2pREkyqoCycAFxYjTxNkx4fVHC2VzvCz9MHz tbggB1Lrx1Tui7a6rEcxJeIOQmDiHCNHjVRU3mg59zhdH/CTBfpEcosTna9T6GH9uMC7 N1yg== X-Gm-Message-State: APjAAAX97yJl/BONSrht3RDMvYKqSeP3/9dKRhSwH9d3phVmBTa19v3S qgYGnUqAimHGvNC7bE8xjP7r/dwdpnA= X-Received: by 2002:a2e:9355:: with SMTP id m21mr4107664ljh.172.1551922708283; Wed, 06 Mar 2019 17:38:28 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id j23sm578634lfb.17.2019.03.06.17.38.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 17:38:28 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id a8so10417080lfi.7 for ; Wed, 06 Mar 2019 17:38:27 -0800 (PST) X-Received: by 2002:ac2:5386:: with SMTP id g6mr5438808lfh.88.1551922237689; Wed, 06 Mar 2019 17:30:37 -0800 (PST) MIME-Version: 1.0 References: <20190307000316.31133-1-viro@ZenIV.linux.org.uk> <20190307004159.GY2217@ZenIV.linux.org.uk> <20190307004828.GZ2217@ZenIV.linux.org.uk> <20190307012036.GA2217@ZenIV.linux.org.uk> In-Reply-To: <20190307012036.GA2217@ZenIV.linux.org.uk> From: Linus Torvalds Date: Wed, 6 Mar 2019 17:30:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/8] aio: make sure file is pinned To: Al Viro Cc: Eric Dumazet , David Miller , Jason Baron , kgraul@linux.ibm.com, ktkhai@virtuozzo.com, kyeongdon kim , Linux List Kernel Mailing , Netdev , pabeni@redhat.com, syzkaller-bugs@googlegroups.com, Cong Wang , Christoph Hellwig , zhengbin , bcrl@kvack.org, linux-fsdevel , linux-aio@kvack.org, houtao1@huawei.com, yi.zhang@huawei.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 6, 2019 at 5:20 PM Al Viro wrote: > > I'll try to massage that series on top of your patch; I still hate the > post-vfs_poll() logics in aio_poll() ;-/ Give me about half an hour > and I'll have something to post. No inherent hurry, I sent the ping just to make sure it hadn't gotten lost. And yeah, I think the post-vfs_poll() logic cannot possibly be necessary. My gut feel is that *if* we have the refcounting right, then we should be able to just let the wakeup come in at any later point, and ordering shouldn't matter all that much, and we shouldn't even need any locking. I'd like to think that it can be done with something like "just 'or' in the mask atomically" (so that we don't care about ordering between the synchronous vfs_poll() and the async poll wakeup), together with "when refcount goes to zero, finish the thing off and complete it" (so that we don't care who finishes first). No "woken" logic, no "who fired first" logic, no BS. Just make the operations work regardless of ordering. And maybe it can't be done. But the current model seems just so hacky that it can't be the right model. Linus