[PATCH 2/2] drm: Serialise multiple event readers

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 25 06:56:05 PST 2015


On Wed, Nov 25, 2015 at 03:44:04PM +0100, Thomas Hellstrom wrote:
> Do you need to take the mutex around other event pullers as well?

We would. I checked in drm/*.c for other users, but not the drivers.
A quick git grep doesn't show any likely candidates, they appear to be
private event lists.

> So that no such process thinks it has pulled all events and then
> suddenly an event reappears?

A short read just implies that the kernel returned all the events it
has. That doesn't imply any new ones haven't manifested in the time it
takes you to see the new events. (You either call read again until it
EAGAINs, or go back to poll.)

> I think there was some event pulling code in one of the drivers, but I
> might be wrong.

I hope not...

> The close() code should be safe against this.

I checked through drm_release and decided that since it cannot happen
whilst drm_read() is active and so I didn't need to worry about having
to break the lock or stop the read.

Anything else of concern?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list