From: Christoph Hellwig <hch@lst.de>
To: Jason Baron <jbaron@akamai.com>
Cc: Christoph Hellwig <hch@lst.de>, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] epoll: use the waitqueue lock to protect ep->wq
Date: Thu, 14 Dec 2017 14:05:28 +0100 [thread overview]
Message-ID: <20171214130528.GA10791@lst.de> (raw)
In-Reply-To: <d3e0d0c9-b9e2-c85d-5c67-30f6f80de42b@akamai.com>
On Thu, Dec 07, 2017 at 11:09:11AM -0500, Jason Baron wrote:
> On 12/06/2017 06:52 PM, Christoph Hellwig wrote:
> > The eoll code currently always uses the unlocked waitqueue helpers for
> > ep->wq, but instead of holding the lock inside the waitqueue around these
> > calls, as expected by the epoll code uses its own lock. Given that the
> > waitqueue is not exposed to the rest of the kernel this actually works
> > ok at the moment, but prevents the epoll locking rules from being
> > enforced using lockdep. Remove ep->lock and use the waitqueue lock
> > to not only reduce the size of struct eventpoll but also make sure we
> > can assert locking invariations in the waitqueue code.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Probably should also fix the locking comments at the top of
> fs/eventpoll.c that refer to ep->lock...
Done. Note that while doing this I noticed that the epoll code
seems to have sketchy workarounds for the fact that it abused ep->poll
as the waitqueue lock that might be able to be removed now.
But I don't really dare to touch the guts of this code.
next prev parent reply other threads:[~2017-12-14 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 23:52 waitqueue lockdep annotation Christoph Hellwig
2017-12-06 23:52 ` [PATCH 1/2] epoll: use the waitqueue lock to protect ep->wq Christoph Hellwig
2017-12-07 0:49 ` Ingo Molnar
2017-12-07 2:38 ` Andreas Dilger
2017-12-07 6:12 ` Ingo Molnar
2017-12-14 13:06 ` Christoph Hellwig
2017-12-07 16:09 ` Jason Baron
2017-12-14 13:05 ` Christoph Hellwig [this message]
2017-12-06 23:52 ` [PATCH 2/2] sched/wait: assert the wait_queue_head lock is held in __wake_up_common Christoph Hellwig
2017-12-07 0:50 ` Ingo Molnar
2017-12-14 13:08 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171214130528.GA10791@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=jbaron@akamai.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).