Re: [PATCH 1/2] epoll: use the waitqueue lock to protect ep->wq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Alternately, a helper that returns the pointer to the lock:

#define waitqueue_lockp(wq) &((wq)->lock)

Used like the following:
        spin_lock_irqsave(waitqueue_lockp(&ep->wq), flags);

Cheers, Andreas



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux