login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
27
Re: [PATCH] video4linux: Push down the BKL
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Mauro Carvalho Chehab
Subject:
Re: [PATCH] video4linux: Push down the BKL
Date: Tuesday, May 27, 2008 - 1:24 pm
On Tue, 27 May 2008 12:50:41 -0700 Arjan van de Ven <arjan@infradead.org> wrote:
quoted text
> On Tue, 27 May 2008 15:59:42 -0300 > Mauro Carvalho Chehab <mchehab@infradead.org> wrote: > > > On Tue, 27 May 2008 10:37:55 -0600 > > Jonathan Corbet <corbet@lwn.net> wrote: > > > > > On Tue, 27 May 2008 13:31:00 -0300 > > > Mauro Carvalho Chehab <mchehab@infradead.org> wrote: > > > > > > > Since the other methods don't explicitly call BKL (and, AFAIK, > > > > kernel open handler don't call it neither), if a program 1 is > > > > opening a device and initializing some data, and a program 2 > > > > starts doing ioctl, interrupting program 1 execution in the > > > > middle of a data initialization procedure, you may have a race > > > > condition, since some devices initialize some device global data > > > > during open [1]. > > > > > > In fact, 2.6.26 and prior kernels *do* acquire the BKL on open (for > > > char devices) - that's the behavior that the bkl-removal tree is > > > there to do away with. So, for example, I've pushed that > > > acquisition down into video_open() instead. > > > > > > So, for now, open() is serialized against ioctl() in video > > > drivers. As soon as you take the BKL out of ioctl(), though, that > > > won't happen, unless the mutex you use is also acquired in the open > > > path. > > > > Ok. > > > > A few drivers seem to be almost read to work without BKL. > > > > For example, em28xx has already a lock at the operations that change > > values at "dev" struct, including open() method. However, since the > > lock is not called at get operations, it needs to be fixed. I would > > also change it from mutex to a read/write semaphore, since two (or > > more) get operations can safely happen in parallel. > > > \ > > please don't use rw/sems just because there MIGHT be parallel. > THey're more expensive than mutexes by quite a bit and you get a lot > less checking from lockdep. They make sense for very specific, very > read biased, contended cases. But please don't use them "just > because"... >
Good point. The nature of get operations on V4L are not worthy enough to justify the loss of lockdep checking. Cheers, Mauro --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] video4linux: Push down the BKL
, Alan Cox
, (Thu May 22, 2:37 pm)
Re: [PATCH] video4linux: Push down the BKL
, Andy Walls
, (Thu May 22, 7:08 pm)
Re: [PATCH] video4linux: Push down the BKL
, Hans Verkuil
, (Thu May 22, 11:16 pm)
Re: [PATCH] video4linux: Push down the BKL
, Hans Verkuil
, (Thu May 22, 11:28 pm)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Fri May 23, 2:09 am)
Re: [PATCH] video4linux: Push down the BKL
, Jonathan Corbet
, (Fri May 23, 6:56 am)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Fri May 23, 8:39 am)
Re: [PATCH] video4linux: Push down the BKL
, Jonathan Corbet
, (Fri May 23, 9:09 am)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Fri May 23, 11:58 am)
Re: [PATCH] video4linux: Push down the BKL
, Hans Verkuil
, (Fri May 23, 12:05 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mike Isely
, (Sun May 25, 4:46 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Mon May 26, 9:34 am)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Mon May 26, 9:39 am)
Re: [PATCH] video4linux: Push down the BKL
, Hans Verkuil
, (Mon May 26, 9:46 am)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Mon May 26, 9:59 am)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Mon May 26, 1:23 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Mon May 26, 2:10 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Mon May 26, 2:14 pm)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Mon May 26, 3:01 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Tue May 27, 6:10 am)
Re: [PATCH] video4linux: Push down the BKL
, Jonathan Corbet
, (Tue May 27, 8:41 am)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Tue May 27, 9:31 am)
Re: [PATCH] video4linux: Push down the BKL
, Jonathan Corbet
, (Tue May 27, 9:37 am)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Tue May 27, 11:14 am)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Tue May 27, 11:59 am)
Re: [PATCH] video4linux: Push down the BKL
, Devin Heitmueller
, (Tue May 27, 12:26 pm)
Re: [PATCH] video4linux: Push down the BKL
, Arjan van de Ven
, (Tue May 27, 12:50 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Tue May 27, 1:24 pm)
Re: [PATCH] video4linux: Push down the BKL
, Mauro Carvalho Chehab
, (Tue May 27, 2:00 pm)
Re: [PATCH] video4linux: Push down the BKL
, Devin Heitmueller
, (Tue May 27, 2:22 pm)
Re: [PATCH] video4linux: Push down the BKL
, Andy Walls
, (Tue May 27, 4:48 pm)
Re: [PATCH] video4linux: Push down the BKL
, Devin Heitmueller
, (Tue May 27, 5:46 pm)
Re: [PATCH] video4linux: Push down the BKL
, Andy Walls
, (Tue May 27, 7:37 pm)
Re: [PATCH] video4linux: Push down the BKL
, Devin Heitmueller
, (Tue May 27, 7:47 pm)
Re: [PATCH] video4linux: Push down the BKL
, Hans Verkuil
, (Tue May 27, 11:13 pm)
Re: [PATCH] video4linux: Push down the BKL
, Alan Cox
, (Wed May 28, 1:34 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [PATCH 0/3] v2 Make hierarchical RCU less IPI-happy and add more tracing
Jeremy Fitzhardinge
Re: Linux 2.6.28.10 and Linux 2.6.29.6 XEN Guest Support Broken x86_64 in BUILD
Nick Piggin
Re: [patch] CFS (Completely Fair Scheduler), v2
Gary Hade
Re: [PATCH 0/5][RFC] Physical PCI slot objects
Dave Johnson
Re: expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device?
linux-netdev
:
Arnd Bergmann
Re: 64-bit net_device_stats
Stephens, Allan
RE: [PATCH]: tipc: Fix oops on send prior to entering networked mode
frank.blaschka
[patch 3/5] [PATCH] qeth: support z/VM VSWITCH Port Isolation
Wu Fengguang
Re: [PATCH] dm9601: handle corrupt mac address
David Miller
Re: [PATCH net-2.6.24] Fix refcounting problem with netif_rx_reschedule()
git
:
Junio C Hamano
Re: [PATCH] [RFC] add Message-ID field to log on git-am operation
Junio C Hamano
Re: Handling large files with GIT
Karl
Re: [ANNOUNCE] pg - A patch porcelain for GIT
Josh Triplett
Re: [RFC][PATCH 00/10] Sparse: Git's "make check" target
Pierre Habouzit
Re: [PATCH] git-daemon: more powerful base-path/user-path settings, using formats.
git-commits-head
:
Linux Kernel Mailing List
MIPS: RBTX4939: Fix IOC pin-enable register updating
Linux Kernel Mailing List
regulator: update email address for Liam Girdwood
Linux Kernel Mailing List
[SCSI] ipr: add message to error table
Linux Kernel Mailing List
powerpc/32: Wire up the trampoline code for kdump
Linux Kernel Mailing List
USB: omap_udc: sync with OMAP tree
openbsd-misc
:
Josh Grosse
Re: error : pkg add phpMyAdmin
Brian Candler
Re: OBSD's perspective on SELinux
Jacob Meuser
Re: /dev/audio: Device busy
David Vasek
Re: Inexpensive, low power, "wall wart" computer
William Boshuck
Re: Richard Stallman...
Colocation donated by:
Syndicate