Re: Can you review or ack this patch?

From: Andrew Morton
Date: Wed Sep 07 2011 - 19:51:23 EST


On Tue, 23 Aug 2011 08:33:25 +0200
Hans Verkuil <hverkuil@xxxxxxxxx> wrote:

> (and resent again, this time with the correct linux-fsdevel mail address)
> (Resent as requested by Andrew Morton since this is still stuck)
>
> Hi Al, Andrew,
>
> Can you take a look at this patch and send an Ack or review comments?
>
> It's already been reviewed by Jon Corbet and we really need this functionality
> for v3.1. You were in the CC list in earlier postings:
>
> Here: http://www.spinics.net/lists/linux-fsdevel/msg46753.html
> and here: http://www.mail-archive.com/linux-media@xxxxxxxxxxxxxxx/msg34546.html
>
> The patch also featured on LWN: http://lwn.net/Articles/450658/
>
> Without your ack Mauro can't upstream this and we have a number of other
> patches that depend on this and are currently blocked.
>
> We would prefer to upstream this patch through the linux-media git tree
> due to these dependencies.
>
> My git branch containing this and the dependent patches is here:
>
> http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/poll
>
> Your help would be greatly appreciated (and your ack even more :-) )!

I'll grab the patch to get it a bit of testing while Al cogitates.

>
>
> [PATCH] poll: add poll_requested_events() function
>
> 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.
>
> Unfortunately, the current epoll/poll/select implementation doesn't provide
> that information reliably. The poll_table_struct does have it: it has a key
> field with the event mask. But once a poll() call matches one or more bits
> of that mask any following poll() calls are passed a NULL poll_table_struct
> pointer.
>
> The solution is to set the qproc field to NULL in poll_table_struct once
> poll() matches the events, not the poll_table_struct pointer itself. That
> way drivers can obtain the mask through a new poll_requested_events inline.
>
> The poll_table_struct can still be NULL since some kernel code calls it
> internally (netfs_state_poll() in ./drivers/staging/pohmelfs/netfs.h). In
> that case poll_requested_events() returns ~0 (i.e. all events).
>
> Since eventpoll always leaves the key field at ~0 instead of using the
> requested events mask, that source was changed as well to properly fill in
> the key field.

It would be nice to find some suitable place in the code where we can
explain all this to other potential users of the capability. Perhaps
the implementation site for the currently undocumented
poll_requested_events() would be a suitable place.

>
> ...
>
> - epi->event.events = event->events;
> + epi->event.events = pt.key = event->events;

coding style nit: we generally try to avoid multiple assignemnts like this.

>
> ...
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/