[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFz6EoiKjzisFmU0j4aezXsPinDyfv3DdKeeKQibkaO6DQ@mail.gmail.com>
Date: Fri, 24 Feb 2012 12:23:08 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Davide Libenzi <davidel@...ilserver.org>,
Eric Dumazet <eric.dumazet@...il.com>,
Greg KH <greg@...ah.com>, Jason Baron <jbaron@...hat.com>,
Roland McGrath <roland@...k.frob.com>,
Eugene Teo <eugeneteo@...nel.sg>,
Maxime Bizon <mbizon@...ebox.fr>,
Denys Vlasenko <dvlasenk@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 0/2] signalfd/epoll fixes
On Fri, Feb 24, 2012 at 11:06 AM, Oleg Nesterov <oleg@...hat.com> wrote:
>
> OK. Please see v2.
Ok, I applied these.
And then, dammit, I unapplied them again.
And then I applied them again.
I'm *really* conflicted, because I have this really strong feeling
that it's just papering over a symptom, and we damn well shouldn't be
doing that. I really think that what we really should do is allow
"poll()" to have a "poll_remove" callback (so each "add_poll_wait()"
will have a callback when it gets remove).
Then we could make the poll() functions actually do allocations and
crap - or at least add refcounts - and the "poll_remove()" ones would
undo them.
And then we could rip out all this, and make signalfd just do
static void poll_remove(struct file *file, struct wait_queue *wq)
{
struct sighand *sighand = container_of(wq, struct sighand, signalfd_wqh);
__cleanup_sighand(sighand);
}
and add that "poll_remove" to its file handler operations. And in
"poll()", it would just do
atomic_inc(&sighand->count);
as it does the poll_wait() thing. Sure, we need to have some way to
test "did we really add it", and only increment the count if so (so
poll_wait() would need to return a value), but this seems to be the
*real* fix. Because the real problem is that we cannot currently
refcount the poll users.
Ok, so it's just a strong feeling, and I *did* end up applying these
two patches after all, but I really wonder how hard it would be to
just add a single new callback function and be able to refcount that
sighand structure itself.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists