All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Ingo Molnar <mingo@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Jason Baron <jbaron@akamai.com>,
	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: Wed, 6 Dec 2017 19:38:48 -0700	[thread overview]
Message-ID: <7AFB0C38-3D2E-45E8-9092-CA424BFD32B6@dilger.ca> (raw)
In-Reply-To: <20171207004914.lxu2dz6cmxgnrou3@gmail.com>

> 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?

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

  reply	other threads:[~2017-12-07  2:38 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 [this message]
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
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=7AFB0C38-3D2E-45E8-9092-CA424BFD32B6@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=jbaron@akamai.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.