Messages in this thread | | | Date | Tue, 27 May 2008 09:41:44 -0600 | From | Jonathan Corbet <> | Subject | Re: [PATCH] video4linux: Push down the BKL |
| |
On Tue, 27 May 2008 10:10:39 -0300 Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> What if we create 3 functions: > > video_ioctl2_bkl() > video_ioctl2_serialized() > video_ioctl2_unlocked() > > The first patch will point .ioctl_unlock to video_ioctl2_bkl. > > A next step would be to move the drivers to use the serialized one.
So we're replacing the big kernel lock with the big v4l2 lock. That might help the situation, but you'd need to be sure to serialize against other calls (open(), for example) which are also currently done under the BKL.
> IMO, we need to create a multi-thread stress userspace tool for > checking the locks at the ioctls. There are a few testing utils at > mercurial tree, under v4l2-apps/test. This can be a starting point > for this tool. Also, Brandon improved one of those tools to work with > multithread.
I don't think that stress tools are the way to eliminate the BKL. You'll never find all the problems that way. There's really no way to avoid the task of actually *looking* at each driver and ensuring that it has its act together with regard to locking.
jon
| |