From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Boyer Subject: Re: [PATCH] epoll: Fix spurious lockdep warnings Date: Wed, 7 Sep 2011 20:04:29 -0400 Message-ID: <20110908000429.GK10700@zod.bos.redhat.com> References: <1312913515-432-1-git-send-email-nelhage@nelhage.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Viro , Davide Libenzi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Paul Bolle , stable@kernel.org To: Nelson Elhage Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756742Ab1IHAF1 (ORCPT ); Wed, 7 Sep 2011 20:05:27 -0400 Content-Disposition: inline In-Reply-To: <1312913515-432-1-git-send-email-nelhage@nelhage.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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@kernel.org > Reported-by: Paul Bolle > Tested-by: Paul Bolle > Signed-off-by: Nelson Elhage Any progress on this heading upstream? josh