[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171207061213.nhm4p5pghfsglkgy@gmail.com>
Date: Thu, 7 Dec 2017 07:12:13 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Andreas Dilger <adilger@...ger.ca>
Cc: Christoph Hellwig <hch@....de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Jason Baron <jbaron@...mai.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] epoll: use the waitqueue lock to protect ep->wq
* Andreas Dilger <adilger@...ger.ca> wrote:
> > On Dec 6, 2017, at 17:49, Ingo Molnar <mingo@...nel.org> wrote:
> >
> > This exposes some waitqueue internals, but AFAICS the FUSE code already does a
> > similar trick with fiq->waitq.lock so there's precedent.
>
> What about waitqueue_lock() and waitqueue_unlock() helpers that
> lock and unlock, to avoid exposing the internals? Or would that add
> confusion by making users think they need their own waitqueue locking?
Right now there are just two users (FUSE and epoll), and both are well-maintained,
essentially core kernel code - I'd rather prefer the readability of explicitly
writing out the locking/unlocking pattern.
So while it's a mild layering violation, it's also a valid looking optimization.
Thanks,
Ingo
Powered by blists - more mailing lists