lkml.org 
[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] epoll: use the waitqueue lock to protect ep->wq

* Andreas Dilger <adilger@dilger.ca> wrote:

> > On Dec 6, 2017, at 17:49, Ingo Molnar <mingo@kernel.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

\
 
 \ /
  Last update: 2017-12-07 07:12    [W:0.040 / U:28.576 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site