From: Jonathan Corbet <corbet@lwn.net>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
"linux-media" <linux-media@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [RFC PATCH] poll: add poll_requested_events() function
Date: Thu, 7 Jul 2011 10:42:55 -0600 [thread overview]
Message-ID: <20110707104255.6771771d@bike.lwn.net> (raw)
In-Reply-To: <201107011537.30829.hverkuil@xs4all.nl>
On Fri, 1 Jul 2011 15:37:30 +0200
Hans Verkuil <hverkuil@xs4all.nl> wrote:
> In some cases the poll() implementation in a driver has to do different
> things depending on the events the caller wants to poll for. An example is
> when a driver needs to start a DMA engine if the caller polls for POLLIN,
> but doesn't want to do that if POLLIN is not requested but instead only
> POLLOUT or POLLPRI is requested. This is something that can happen in the
> video4linux subsystem.
The change makes sense to me, FWIW. One bit of trivia I noticed while
looking at it:
> @@ -796,7 +792,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
> * All waiters have already been registered, so don't provide
> * a poll_table to them on the next loop iteration.
> */
> - pt = NULL;
> + pt->qproc = NULL;
> if (!count) {
> count = wait->error;
> if (signal_pending(current))
The comment at the beginning of this hunk is no longer accurate since the
poll_table is, indeed, still being supplied. The previous comment in the
same function:
/*
* Fish for events. If we found one, record it
* and kill the poll_table, so we don't
* needlessly register any other waiters after
* this. They'll get immediately deregistered
* when we break out and return.
*/
Could also use tweaking.
jon
next prev parent reply other threads:[~2011-07-07 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 13:37 Hans Verkuil
2011-07-07 16:42 ` Jonathan Corbet [this message]
2011-07-07 16:46 ` Hans Verkuil
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=20110707104255.6771771d@bike.lwn.net \
--to=corbet@lwn.net \
--cc=hverkuil@xs4all.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.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
all inboxes | Powered by JetHome®