Re: [PATCH 0/5] Pushdown bkl from v4l ioctls

From: Arnd Bergmann
Date: Fri Apr 30 2010 - 16:32:45 EST


On Thursday 29 April 2010 09:10:42 Laurent Pinchart wrote:
> On Thursday 29 April 2010 08:44:29 Hans Verkuil wrote:
> >
> > 3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
> > global mutex. Those drivers that call the bkl themselves should probably be
> > converted to do proper locking, but there are only about 14 drivers that do
> > this. The other 60 or so drivers should work fine if a v4l2-dev global lock
> > is used. At this point the bkl is effectively removed from the v4l
> > subsystem.
> >
> > 4) Work on the remaining 60 drivers to do proper locking and get rid of the
> > v4l2-dev global lock. This is probably less work than it sounds.
> >
> > Since your patch moves everything down to the driver level it will actually
> > make this work harder rather than easier. And it touches almost all drivers
> > as well.
>
> Every driver will need to be carefully checked to make sure the BKL can be
> replaced by a v4l2-dev global mutex. Why would it be more difficult to do so
> if the BKL is pushed down to the drivers ?

Note that you can completely skip the step of a v4l2-dev global mutex with
Frederic's patch. This is the only use of the BKL in the common v4l2
code as far as I can tell, so instead of introducing yet another global
lock, you can go straight to stage 4 and look at each driver separately,
possibly introducing a per driver lock.

Arnd
--
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/