Re: [PATCH 1/8] aio: make sure file is pinned
From: Linus Torvalds
Date: Wed Mar 06 2019 - 20:38:32 EST
On Wed, Mar 6, 2019 at 5:20 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> 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