Re: [PATCH] epoll: Fix spurious lockdep warnings

From: Josh Boyer
Date: Wed Sep 07 2011 - 20:05:30 EST


On Tue, Aug 09, 2011 at 02:11:55PM -0400, Nelson Elhage wrote:
> epoll can acquire recursively acquire ep->mtx on multiple "struct
> eventpoll"s at once in the case where one epoll fd is monitoring
> another epoll fd. This is perfectly OK, since we're careful about the
> lock ordering, but it causes spurious lockdep warnings. Annotate the
> recursion using mutex_lock_nested, and add a comment explaining the
> nesting rules for good measure.
>
> Recent versions of systemd are triggering this, and it can also be
> demonstrated with the following trivial test program:
>
> --------------------8<--------------------
>
> int main(void) {
> int e1, e2;
> struct epoll_event evt = {
> .events = EPOLLIN
> };
>
> e1 = epoll_create1(0);
> e2 = epoll_create1(0);
> epoll_ctl(e1, EPOLL_CTL_ADD, e2, &evt);
> return 0;
> }
> --------------------8<--------------------
>
> Cc: stable@xxxxxxxxxx
> Reported-by: Paul Bolle <pebolle@xxxxxxxxxx>
> Tested-by: Paul Bolle <pebolle@xxxxxxxxxx>
> Signed-off-by: Nelson Elhage <nelhage@xxxxxxxxxxx>

Any progress on this heading upstream?

josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/