lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] videodev: fix sysfs kobj ref count
- Date: Thu, 3 Jul 2008 12:52:37 -0400
- From: "David Ellingsworth" <david@xxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] videodev: fix sysfs kobj ref count
OK, here's my analysis of the locking situation:
video_open and video_close are both called with the BKL held and are
therefore non-preemptable. This means that video_open and video_close
will always run from beginning to end without interruption by any of
the other functions. Keeping this in mind, lets evaluate the following
sequences:
video_register_device (preempted)
video_open
video_register_device (preempted)
video_close
video_unregister_device (preempted)
video_open
video_unregister_device (preempted)
video_close
In all of the above sequences, videodev_lock is obtained by
video_register_device or video_unregister_device. video_open and
video_close will then deadlock while waiting to obtain the lock. Since
video_open and video_close can not be preempted, the lock will never
be obtained. The first and third above currently exist without this
patch. The second and fourth are a result of this patch.
Due to the use of the BKL, I cannot currently think of any viable
solutions to these issues. These issues might be solvable once the BKL
is removed, but it will also present a whole range of other
challenges.
Regards,
David Ellingsworth
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list